예제 #1
0
 public void AttachEdge(SectionEdge edge, EdgeType type)
 {
     if (type == EdgeType.Input)
     {
         InputEdges.Add(edge);
     }
     else
     {
         OutputEdges.Add(edge);
     }
 }
예제 #2
0
 public TrainRunSection(Route route, ServiceIntention train, SectionEdge section)
 {
     RouteId        = route.Id;
     RoutePathId    = section.RoutePath;
     SequenceNumber = section.SequenceNumber;
     if (train.SectionRequirements != null && section.SectionMarker != null)
     {
         SectionRequirement = train.SectionRequirementsDic.ContainsKey(section.SectionMarker)
             ? section.SectionMarker
             : null;
     }
 }
예제 #3
0
        public void Add(SectionEdge edge)
        {
            Sections.Add(edge);
            lastNode = edge.Exit;
            if (edge.SectionMarker != null)
            {
                SectionMarkers.Add(edge.SectionMarker);
            }

            if (edge.Penalty.HasValue)
            {
                Penalty += edge.Penalty.Value;
            }

            foreach (var res in edge.ResourceOccupations)
            {
                _resourceOccupied.Add(res);
            }
        }
예제 #4
0
 public PossiblePath(PossiblePath basePath, SectionEdge edge)
 {
     Sections.AddRange(basePath.Sections);
     Add(edge);
 }