Microscopic Traffic Simulator
Lane.cs
Go to the documentation of this file.
3 using System;
4 using System.Collections.Generic;
5 using System.Collections.ObjectModel;
6 using System.Windows;
7 
8 namespace Microscopic_Traffic_Simulator___Model.GeometricObjects.Lanes
9 {
13  [Serializable]
14  public abstract class Lane
15  {
19  protected StartNode startNode;
23  public StartNode StartNode { get { return startNode; } }
24 
28  protected Node endNode;
32  public Node EndNode { get { return endNode; } }
33 
37  private List<InnerNode> innerNodes = new List<InnerNode>();
41  public ReadOnlyCollection<InnerNode> InnerNodes { get { return innerNodes.AsReadOnly(); } }
42 
48  protected Lane(Point startPoint, Point endPoint)
49  {
50  startNode = new StartNode(startPoint);
51  innerNodes.Add(new SensorNode(new Point(), 0.5, new Sensor("in.txt", "out.txt")));
52  endNode = new EndNode(endPoint);
53  }
54 
60  internal abstract IEnumerable<Point> LanePoints(double lanePointsMaxDistance);
61 
66  public void AddInnerNode(InnerNode innerNodeToAdd)
67  {
68  innerNodes.Add(innerNodeToAdd);
69  }
70  }
71 }
StartNode startNode
Node on the input end of lane.
Definition: Lane.cs:19
void AddInnerNode(InnerNode innerNodeToAdd)
Adds new inner node.
Definition: Lane.cs:66
Node on the beginning of the lane and can also contain generator.
Definition: StartNode.cs:11
Node on the lane which is not the start or end node.
Definition: InnerNode.cs:10
Lane(Point startPoint, Point endPoint)
Lane constructor.
Definition: Lane.cs:48
Node endNode
Node on the output end of lane.
Definition: Lane.cs:28
Class representing an object in topology on lane.
Definition: Node.cs:10