public OperationGraph(OrderOperationGraph orderOperationGraph) : base() { IStackSet <IGraphNode> nodes = new StackSet <IGraphNode>(orderOperationGraph.GetNodes()); foreach (var graphNode in nodes) { if (graphNode.GetNode().GetEntity().GetType() != typeof(ProductionOrderOperation)) { orderOperationGraph.RemoveNode(graphNode.GetNode(), true); } } _nodes = orderOperationGraph.GetNodes(); }
public void TestParentsDueTimeIsGreaterThanOrEqualToChildsDueTime( string testConfigurationFileName) { // init InitTestScenario(testConfigurationFileName); IZppSimulator zppSimulator = new ZppSimulator.impl.ZppSimulator(); // TODO: set to true once dbPersist() has an acceptable time zppSimulator.StartTestCycle(false); // TODO: replace this by ReloadTransactionData() once shouldPersist is enabled ZppConfiguration.CacheManager.GetDbTransactionData(); OrderOperationGraph orderOperationGraph = new OrderOperationGraph(); foreach (var graphNode in orderOperationGraph.GetNodes()) { INode node = graphNode.GetNode(); INodes successors = orderOperationGraph.GetSuccessorNodes(node); if (successors != null) { foreach (var successor in successors) { if (node.GetEntity().GetType() == typeof(CustomerOrderPart)) { continue; } Assert.True( node.GetEntity().GetStartTimeBackward() .IsGreaterThanOrEqualTo(successor.GetEntity().GetEndTimeBackward()), "Parent's StartTimeBackward must be greater or equal to than child's EndTimeBackward."); } } } }