Ejemplo n.º 1
0
 internal void ReplaceAllocator(string s)
 {
     logger.Info("Replace allocator: " + s);
     if (s == "AmbulanceAtStationAllocator")
     {
         allocator = new AmbulanceAtStationAllocator(mapService, new LoggedDatabase(config));
         configurationRepository.UpdateActiveAllocator(s);
     }
     else if (s == "DefaultAmbulanceAllocator")
     {
         allocator = new DefaultAmbulanceAllocator(mapService, new LoggedDatabase(config));
         configurationRepository.UpdateActiveAllocator(s);
     }
     else
     {
         logger.Info("Allocator name not known");
     }
 }
Ejemplo n.º 2
0
        public Checker(IDatabaseBuildConfiguration config)
        {
            this.config = config;
            var db = new Database(config);

            ambulanceRepository     = new AmbulanceRepository(db);
            hospitalRepository      = new HospitalRepository(db);
            incidentRepository      = new IncidentRepository(db);
            allocationRepository    = new AllocationRepository(db);
            configurationRepository = new ConfigurationRepository(db);

            mapService = new MapService();

            allocator = new DefaultAmbulanceAllocator(mapService, new LoggedDatabase(config));
            configurationRepository.UpdateActiveAllocator("DefaultAmbulanceAllocator");

            mobilizator           = new AmbulanceMobilizator(new Database(config));
            trafficJamReallocator = new TrafficJamReallocator(mapService, new LoggedDatabase(config));
            cancelator            = new Cancelator(new Database(config));
        }