// end of metrics public RoutingSolutionObject(RoutingSolver routingSolver, Assignment solution) { _routingSolver = routingSolver; _solution = solution; ComputeSolutionData(_solution); //SolutionToVehicleRouteMetrics(_solution); MetricsContainer = new MetricsContainer(); RegisterAllMetrics(); }
public SimulationVehicleMetricsStatistics(Simulation.Simulation simulation) { _simulation = simulation; _vehiclesUsed = _simulation.Context.VehicleFleet.FindAll(v => v.TripIterator?.Current != null && v.ServedCustomers.Count > 0); //debug; List <Customer> allServedCustomers = new List <Customer>(); foreach (var v in _vehiclesUsed) { foreach (var cust in v.ServedCustomers) { if (allServedCustomers.FindAll(c => c.Id == cust.Id).Count > 0) { Console.WriteLine("A"); } allServedCustomers.Add(cust); } } //end of debug MetricsContainer = new MetricsContainer(); ComputeOverallMetrics(); }