Exemplo n.º 1
0
 public void AttachEdge(SectionEdge edge, EdgeType type)
 {
     if (type == EdgeType.Input)
     {
         InputEdges.Add(edge);
     }
     else
     {
         OutputEdges.Add(edge);
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
0
 public PossiblePath(PossiblePath basePath, SectionEdge edge)
 {
     Sections.AddRange(basePath.Sections);
     Add(edge);
 }