const StateToNumber = {
	CreateWorkStep: 1,
	UpdateWorkStep: 2,
	CreateSources: 3,
	FillFromSources: 4,
	AfterFillFromSources: 5,
	Finished: 6,
};

function less(lhs: GraphNodeProcessingState, rhs: GraphNodeProcessingState): boolean {
	if (!StateToNumber[lhs]) {
		return wsi4.throwError("less(): Missing State in Map");
	}
	if (!StateToNumber[rhs]) {
		return wsi4.throwError("less(): Missing State in Map");
	}
	return StateToNumber[lhs] < StateToNumber[rhs];
}
/**
 *
 * Compute minimum [[GraphNodeProcessingState]]
 */
export function min(lhs: GraphNodeProcessingState, rhs: GraphNodeProcessingState): GraphNodeProcessingState {
	return less(lhs, rhs) ? lhs : rhs;
}

