public Simulation(ScenarioModel scenario) { if (scenario == null) { throw new ArgumentNullException("scenario is null"); } //System.Threading.Timer t = new System.Threading.Timer(new System.Threading.TimerCallback((o) => Step()), null, 0, (long)STEP_TIME_MS); _scenario = scenario; RoadGraph = new Graph<WayPoint, PathFigure>(); if (_scenario.RoadGraph != null) { foreach (var node in _scenario.RoadGraph.Nodes) { RoadGraph.Add(node); } foreach (var edge in _scenario.RoadGraph.Edges) { var pathGeom = PathGeometry.CreateFromGeometry(PathGeometry.Parse(edge.Data)); RoadGraph.AddEdge(edge.Start, edge.End, pathGeom.Figures.First()); } } _analisisCollector = new Analisis.AnalisisCollector(); _map = _scenario.Map; _start = _scenario.StartTime; _end = _scenario.EndTime; _simulationTime = _scenario.StartTime; Init(STEP_TIME_MS); }
public Simulation(ScenarioModel scenario) { if (scenario == null) { throw new ArgumentNullException("scenario is null"); } //System.Threading.Timer t = new System.Threading.Timer(new System.Threading.TimerCallback((o) => Step()), null, 0, (long)STEP_TIME_MS); _scenario = scenario; RoadGraph = new Graph <WayPoint, PathFigure>(); if (_scenario.RoadGraph != null) { foreach (var node in _scenario.RoadGraph.Nodes) { RoadGraph.Add(node); } foreach (var edge in _scenario.RoadGraph.Edges) { var pathGeom = PathGeometry.CreateFromGeometry(PathGeometry.Parse(edge.Data)); RoadGraph.AddEdge(edge.Start, edge.End, pathGeom.Figures.First()); } } _analisisCollector = new Analisis.AnalisisCollector(); _map = _scenario.Map; _start = _scenario.StartTime; _end = _scenario.EndTime; _simulationTime = _scenario.StartTime; Init(STEP_TIME_MS); }