/// <summary>
        /// Initializes a new instance of the <see cref="DrayageOptimizer"/> class.
        /// </summary>
        /// <param name="probabilityMatrix">The probability matrix.</param>
        /// <param name="routeService">The route service.</param>
        /// <param name="routeExitFunction">The route exit function.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="pheromoneMatrix">The pheromone matrix.</param>
        /// <param name="nodeService">The node service.</param>
        /// <param name="randomNumberGenerator">The random number generator.</param>
        /// <param name="nodeFactory">The node factory.</param>
        /// <param name="jobNodeService">The job Node Service.</param>
        /// <param name="routeStopService">The route stop service.</param>
        public DrayageOptimizer(IProbabilityMatrix probabilityMatrix,
                                IRouteService routeService,
                                IRouteExitFunction routeExitFunction,
                                ILogger logger,
                                IPheromoneMatrix pheromoneMatrix,
                                IRandomNumberGenerator randomNumberGenerator,
                                IRouteStatisticsService routeStatisticsService,
                                IJobNodeService jobNodeService,
                                IRouteStopService routeStopService)
        {
            _probabilityMatrix      = probabilityMatrix;
            _routeExitFunction      = routeExitFunction;
            _logger                 = logger;
            _pheromoneMatrix        = pheromoneMatrix;
            _randomNumberGenerator  = randomNumberGenerator;
            _routeStatisticsService = routeStatisticsService;
            _jobNodeService         = jobNodeService;
            _routeStopService       = routeStopService;
            _routeService           = routeService;

            // default values
            EnableParallelism           = true;
            PheromoneUpdateFrequency    = 5;
            MaxIterations               = 20000;
            MaxIterationSinceBestResult = 1500;
            MaxExecutionTime            = 100;
        }
Example #2
0
 /// <summary>Initializes a new instance of the <see cref="JobService"/> class.</summary>
 /// <param name="repository">The repository.</param>
 /// <param name="cacheManager">The cache manager.</param>
 /// <param name="routeStopService">The route stop service.</param>
 /// <param name="stopActionService">The stop action service.</param>
 public JobService(IRepository <Job> repository, ICacheManager cacheManager, IRouteStopService routeStopService, IStopActionService stopActionService, IJobGroupService jobGroupService, IDateTimeHelper dateTimeHelper, ILocationDistanceService locationDistanceService)
     : base(repository, cacheManager)
 {
     _routeStopService        = routeStopService;
     _stopActionService       = stopActionService;
     _jobGroupService         = jobGroupService;
     _dateTimeHelper          = dateTimeHelper;
     _locationDistanceService = locationDistanceService;
 }
        public NodeRouteService(IObjectiveFunction objectiveFunction,
                                IRouteStopService routeStopService, IRouteExitFunction routeExitFunction, ILogger logger,
                                OptimizerConfiguration configuration)
        {
            _objectiveFunction = objectiveFunction;
            _routeStopService  = routeStopService;
            _routeExitFunction = routeExitFunction;
            _configuration     = configuration;
            _logger            = logger;

            _nodeConnectionCache = new Dictionary <Tuple <INode, INode>, NodeConnection>();
        }
Example #4
0
        public void SetUp()
        {
            Kernel.Bind <IEngine>().To <Engine>().InSingletonScope();

            // Run installation tasks
            Kernel.Bind(x =>
                        x.FromAssemblyContaining <StateService>()
                        .SelectAllClasses()
                        .BindAllInterfaces()
                        .Configure(f => f.InTransientScope()));

            // Bind Database Repository
            Kernel.Rebind(typeof(IRepository <>)).To(typeof(EfRepository <>));

            Kernel.Bind <IDbContext>().To <DataContext>().InTransientScope()
            .WithConstructorArgument("nameOrConnectionString", ConnectionStringManager.ConnectionString);

            Kernel.Bind <IIncluder>().To <DbIncluder>().InTransientScope();

            Kernel.Rebind <ICacheManager>().To <MemoryCacheManager>().InThreadScope();

            Kernel.Rebind <ILogService>().To <LogService>().InThreadScope();

            _jobGroupService = Kernel.Get <IJobGroupService>();

            _chassisService        = Kernel.Get <IChassisService>();
            _containerOwnerService = Kernel.Get <IContainerOwnerService>();
            _containerService      = Kernel.Get <IContainerService>();
            _stopActionService     = Kernel.Get <IStopActionService>();

            _driverService           = Kernel.Get <IDriverService>();
            _userService             = Kernel.Get <IUserService>();
            _stateService            = Kernel.Get <IStateService>();
            _locationService         = Kernel.Get <ILocationService>();
            _locationDistanceService = Kernel.Get <ILocationDistanceService>();

            Kernel.Rebind <IDomainModelMapper>().To <DomainModelAutoMapper>().InThreadScope();
            _mappingService = Kernel.Get <IDomainModelMapper>();

            _jobService           = Kernel.Get <IJobService>();
            _routeStopService     = Kernel.Get <IRouteStopService>();
            _locationGroupService = Kernel.Get <ILocationGroupService>();
            _weatherCityService   = Kernel.Get <IWeatherCityService>();

            AutoMapperInitializer.Initialize();
        }
 public LegacyImportService(ILocationService locationService, IStopActionService stopActionService, IJobService jobService, IRouteStopService routeStopService, IGeocodeService geocodeService, IJobGroupService jobGroupService, IDriverService driverService, ISyncLogEntryService syncLogEntryService, IDistanceService distanceService)
 {
     _locationService     = locationService;
     _stopActionService   = stopActionService;
     _jobService          = jobService;
     _routeStopService    = routeStopService;
     _geocodeService      = geocodeService;
     _jobGroupService     = jobGroupService;
     _driverService       = driverService;
     _syncLogEntryService = syncLogEntryService;
     _distanceService     = distanceService;
     _validationService   = new ValidationService(
         new[]
     {
         new TimeSpan(11, 11, 0)
     }
         );
 }
Example #6
0
        public DrayageOptimizer(IProbabilityMatrix probabilityMatrix,
                                IRouteService routeService, INodeService nodeService, IRouteStopService routeStopService,
                                IRouteExitFunction routeExitFunction, ILogger logger, IPheromoneMatrix pheromoneMatrix, IRandomNumberGenerator randomNumberGenerator, INodeFactory nodeFactory)
        {
            _probabilityMatrix     = probabilityMatrix;
            _routeStopService      = routeStopService;
            _routeExitFunction     = routeExitFunction;
            _logger                = logger;
            _pheromoneMatrix       = pheromoneMatrix;
            _randomNumberGenerator = randomNumberGenerator;
            this._nodeFactory      = nodeFactory;
            _nodeService           = nodeService;
            _routeService          = routeService;

            // default values
            EnableParallelism           = false;
            PheromoneUpdateFrequency    = 10;
            MaxIterations               = 10000;
            MaxIterationSinceBestResult = 1000;
            MaxExecutionTime            = 10000;
        }
 public DefaultNodeConnectionFactory(IRouteStopService routeStopService)
 {
     _routeStopService = routeStopService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportingService"/> class.
 /// </summary>
 /// <param name="routeStopService">The route stop service.</param>
 /// <param name="routeService">The route service.</param>
 public ReportingService(IRouteStopService routeStopService, IRouteService routeService)
 {
     _routeStopService = routeStopService;
     _routeService     = routeService;
 }
 public LocationDistanceService(IRepository <LocationDistance> repository, ICacheManager cacheManager, IRouteStopService routeStopService, ILocationService locationService)
     : base(repository, cacheManager)
 {
     _routeStopService = routeStopService;
     _locationService  = locationService;
 }
 public RouteStatisticsService(IRouteStopService routeStopService, INodeService nodeService, OptimizerConfiguration configuration)
 {
     _routeStopService = routeStopService;
     _nodeService      = nodeService;
     _configuration    = configuration;
 }
Example #11
0
 public NodeService(IRouteStopService routeStopService, OptimizerConfiguration configuration)
 {
     _configuration = configuration;
     _routeStopService = routeStopService;
 }
Example #12
0
 public NodeFactory(IRouteStopService routeStopService)
 {
     _routeStopService = routeStopService;
 }