public SystemStateGraph(MultipleModuleSystem system, bool includeTerminal) { _system = system; _allPossibleStates = GetAllPossibleStates(); Transitions = GetPossibleTransitions(includeTerminal); }
public static SystemState FromModuleStatesIndices( MultipleModuleSystem system, int[] moduleStateIndices, IReadOnlyList <IReadOnlyList <ModuleState> > modulesStates, int stateIndex) { var moduleStates = new List <ModuleState>(); for (var index = 0; index < moduleStateIndices.Length; index++) { var possibleModuleStates = modulesStates[index]; var moduleStateIndex = moduleStateIndices[index]; moduleStates.Add(possibleModuleStates[moduleStateIndex]); } var systemState = new SystemState(moduleStates, stateIndex); systemState.IsTerminal = system.IsStateTerminal(systemState); systemState.IsWaitingRecovery = system.WaitingRecovery(systemState); systemState.IsWorking = system.IsWorking(systemState); return(systemState); }