public DijkstraResolve(ISet <DijkstraVertex> dijkstraVertices, ICityMap cityMap, ICityPlace startPlace) { _dijkstraVertices = dijkstraVertices; CityMap = cityMap; StartPlace = startPlace; }
public Model(IReadOnlyCollection <IVehicleModel> vehicleModels, IReadOnlyCollection <IVehicle> vehicles, ICityMap cityMap, IGoods goods) { VehicleModels = vehicleModels; Vehicles = vehicles; CityMap = cityMap; Goods = goods; }
public Optimizer(ICityMap cityMap) { CityMap = cityMap; _dijkstraResolve = new DijkstraResolver() .Resolve(cityMap, cityMap.Places.First(x => x is IWarehouse)); }
public SimulationService( ICityMap cityMap, IEnumerable <VehicleModel> availableVehicleModels, IOptimizer optimizer) { _optimizer = optimizer; CityMap = cityMap; _availableVehicleModels = availableVehicleModels.ToList(); TimeModifier = 60; CurrentDateTime = DateTime.Now; var resultBinding = this.WhenAnyValue(x => x.Profit, x => x.Leasing, x => x.Penalty) .Select(x => x.Item1 - x.Item2 - x.Item3) .Subscribe(x => Result = x); _cleanUp = Disposable.Create(() => { _currentTimer?.Dispose(); resultBinding.Dispose(); }); }
public DijkstraResolve Resolve(ICityMap cityMap, ICityPlace startPoint) { _cityMap = cityMap; _vertexes = InitDijkstraVertexes(cityMap.Places); _vertexes .First(x => x.CityPlace == startPoint) .EdgesWeightSum = 0; while (true) { var current = FindUnvisitedVertexWithMinSum(); if (current == null) { break; } SetOptimalWaysForNeighbor(current); } return(new DijkstraResolve(_vertexes, cityMap, startPoint)); }
public TicketWindow(ICityMap cityMap) { _cityMap = cityMap; }