public ServiceBase GetInstance(ulong serviceId, Enviroment.Map map, Enviroment.WayPoint location, Dictionary <string, object> settings) { BusStop service = new BusStop(serviceId, map, location); service.Initialize(settings); return(service); }
public AgentBase GetInstance(Enviroment.Map map, IEnumerable <Contracts.Services.AgentServiceBase> services, Dictionary <string, object> settings) { var agent = new Vehicle(map, services); agent.Initialize(settings); return(agent); }
public BusStop(ulong id, Enviroment.Map map, Enviroment.WayPoint location) { base.Id = id; base.Dislocation = location; _map = map; _servicePoint = new Point(location.X, location.Y); }
public Crosswalk(Enviroment.Map map, List <Point> mapCells) : base(map, mapCells) { foreach (var cell in mapCells) { map[0].SetCell(cell.X, cell.Y, new Enviroment.Model.Cell(0x01) { TemporarilyClosed = true }); } }
public ScenarioModel() { _transitionGraph = new Graph <WayPoint, double>(); _roadGraph = new Graph <WayPoint, string>(); _scenarioConfig = new ExperimentConfiguration(); _modulesSettings = new Dictionary <string, Dictionary <string, object> >(); Map = new Enviroment.Map(); AgentGroups = new List <AgentsGroup>(); Services = new List <ServiceModel>(); StartTime = DateTime.Now; EndTime = DateTime.Now.AddHours(5); }
public void Initialize(Enviroment.Map map, Dictionary <string, object> settings) { _map = map; if (map.Count == 0) { Width = 800; Height = 600; Background = Brushes.Gainsboro; } else { Width = map[0].Width; Height = map[0].Height; if (map[0].Substrate != null) { Background = new ImageBrush(Helpers.Imaging.ImageManager.BitmapToBitmapImage(map[0].Substrate)); } else { Background = Brushes.Gainsboro; } } if (_passengerDensity == null || _passengerLastLocations == null) { _passengerDensity = new uint[Width, Height]; _passengerLastLocations = new ulong[Width, Height]; } //_worker = new BackgroundWorker(); //_worker.DoWork += (s, e) => //{ // _spectralBrush = GetSpectorImageBrush(); //}; //_worker.RunWorkerCompleted += (s, e) => //{ // OnPropertyChanged("SpectralBrush"); // //if (e.Result is ImageBrush) // //{ // // SpectralBrush = (ImageBrush)e.Result; // //} //}; OnPropertyChanged("Width"); OnPropertyChanged("Height"); OnPropertyChanged("Background"); }
public void Initialize(Enviroment.Map map, Dictionary<string, object> settings) { _map = map; if (map.Count == 0) { Width = 800; Height = 600; Background = Brushes.Gainsboro; } else { Width = map[0].Width; Height = map[0].Height; if (map[0].Substrate != null) { Background = new ImageBrush(Helpers.Imaging.ImageManager.BitmapToBitmapImage(map[0].Substrate)); } else { Background = Brushes.Gainsboro; } } if (_passengerDensity == null || _passengerLastLocations == null) { _passengerDensity = new uint[Width, Height]; _passengerLastLocations = new ulong[Width, Height]; } //_worker = new BackgroundWorker(); //_worker.DoWork += (s, e) => //{ // _spectralBrush = GetSpectorImageBrush(); //}; //_worker.RunWorkerCompleted += (s, e) => //{ // OnPropertyChanged("SpectralBrush"); // //if (e.Result is ImageBrush) // //{ // // SpectralBrush = (ImageBrush)e.Result; // //} //}; OnPropertyChanged("Width"); OnPropertyChanged("Height"); OnPropertyChanged("Background"); }
public MapServiceBase(Enviroment.Map map, List<Point> mapCells) { _map = map; _mapCells = mapCells; }
public MapServiceBase(Enviroment.Map map, List <Point> mapCells) { _map = map; _mapCells = mapCells; }
public ScenarioModel() { _transitionGraph = new Graph<WayPoint, double>(); _roadGraph = new Graph<WayPoint, string>(); _scenarioConfig = new ExperimentConfiguration(); _modulesSettings = new Dictionary<string, Dictionary<string, object>>(); Map = new Enviroment.Map(); AgentGroups = new List<AgentsGroup>(); Services = new List<ServiceModel>(); StartTime = DateTime.Now; EndTime = DateTime.Now.AddHours(5); }