Changeset 8714
- Timestamp:
- 10/02/12 09:27:40 (12 years ago)
- Location:
- branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/HeuristicLab.PDPSimulation-3.3.csproj
r8674 r8714 181 181 <Compile Include="DistanceMeasures\EuclideanDistanceMeasure.cs" /> 182 182 <Compile Include="DomainModel\SimulationObject.cs" /> 183 <Compile Include="Operators\DialARideEvaluator.cs" /> 183 184 <Compile Include="Operators\DynPDPEvaluator.cs" /> 184 185 <Compile Include="Operators\DynPushForwardInsertionCreator.cs" /> -
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Operators/DynPDPProblemInstance.cs
r8670 r8714 212 212 TardinessPenalty.Value = scenario.TardinessPenaltyParameter.Value.Value; 213 213 FleetUsageFactor.Value = scenario.FleetUsageFactorParameter.Value.Value; 214 DistanceFactor.Value = scenario.DistanceFactorParameter.Value.Value; 214 215 } 215 216 } -
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliveryAnalyzer.cs
r8670 r8714 108 108 data.Rows.Add(new DataRow("InvalidActions")); 109 109 data.Rows.Add(new DataRow("Tardiness")); 110 data.Rows.Add(new DataRow("CapacityUtilization")); 110 111 111 112 results.Add(new Result("UsedVehicles", new IntValue())); … … 120 121 double distance = Math.Round(simulation.Vehicles.Sum(v => v.Distance) * 100.0) / 100.0; 121 122 int invalidActions = simulation.Vehicles.Sum(v => v.InvalidActions); 122 double tardiness = Math.Round(simulation.Vehicles.Sum(v => v.Tardiness) * 100.0) / 100.0; 123 double tardiness = Math.Round(simulation.Vehicles.Sum(v => v.Tardiness) * 100.0) / 100.0; 124 var used = simulation.Vehicles.Where(v => v.Distance > 0); 125 double capacityUtilization = 0; 126 if(used.Count() > 0) 127 capacityUtilization = Math.Round(used.Average(v => 1.0 - (v.Capacity / v.TotalCapacity)) * 100.0) / 100.0; 123 128 124 129 vehicleStatistics.Rows["UsedVehicles"].Values.Add(usedVehicles); … … 126 131 vehicleStatistics.Rows["InvalidActions"].Values.Add(invalidActions); 127 132 vehicleStatistics.Rows["Tardiness"].Values.Add(tardiness); 133 vehicleStatistics.Rows["CapacityUtilization"].Values.Add(capacityUtilization); 128 134 129 135 (results["UsedVehicles"].Value as IntValue).Value = usedVehicles; … … 183 189 } 184 190 191 protected virtual void UpdateTimeHistogram(PickupDeliverySimulation simulation, PickupDeliveryScenario scenario, ResultCollection results) { 192 if (!results.ContainsKey("TimeHistogram")) { 193 DataTable data = new DataTable("TimeHistogram"); 194 results.Add(new Result("TimeHistogram", data)); 195 196 DataRow row = new DataRow("WaitingTime"); 197 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 198 data.Rows.Add(row); 199 200 row = new DataRow("TransferTime"); 201 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 202 data.Rows.Add(row); 203 204 row = new DataRow("Slack"); 205 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 206 data.Rows.Add(row); 207 208 row = new DataRow("LeadTime"); 209 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 210 data.Rows.Add(row); 211 } 212 213 DataTable timeHistogram = results["TimeHistogram"].Value.Clone() as DataTable; 214 215 //waiting time 216 var values = timeHistogram.Rows["WaitingTime"].Values; 217 values.Clear(); 218 foreach (Order order in simulation.Orders.Where(o => o.PickupTime > 0)) { 219 values.Add(order.PickupTime - order.PickupReadyTime); 220 } 221 222 //transfer time 223 values = timeHistogram.Rows["TransferTime"].Values; 224 values.Clear(); 225 foreach (Order order in simulation.Orders.Where(o => o.OrderState == OrderState.Delivered)) { 226 values.Add(order.DeliveryTime - order.PickupTime - order.PickupServiceTime); 227 } 228 229 //slack 230 values = timeHistogram.Rows["Slack"].Values; 231 values.Clear(); 232 foreach (Order order in simulation.Orders.Where(o => o.PickupTime > 0)) { 233 values.Add(order.PickupDueTime - order.PickupTime); 234 } 235 236 //lead time 237 values = timeHistogram.Rows["LeadTime"].Values; 238 values.Clear(); 239 foreach (Order order in simulation.Orders.Where(o => o.OrderState == OrderState.Delivered)) { 240 values.Add(order.DeliveryTime + order.DeliveryServiceTime - order.PickupReadyTime); 241 } 242 243 results["TimeHistogram"].Value = timeHistogram; 244 } 245 185 246 public virtual void Analyze(PickupDeliverySimulation simulation, PickupDeliveryScenario scenario, ResultCollection results) { 186 247 UpdateOrderResults(simulation, scenario, results); … … 188 249 UpdateConstraintViolationResults(simulation, scenario, results); 189 250 UpdateVehicleHistoryResults(simulation, scenario, results); 251 UpdateTimeHistogram(simulation, scenario, results); 190 252 } 191 253 -
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliveryScenario.cs
r8670 r8714 73 73 } 74 74 75 public IValueParameter<DoubleValue> DistanceFactorParameter { 76 get { return (IValueParameter<DoubleValue>)Parameters["DistanceFactor"]; } 77 } 78 75 79 public IValueParameter<DoubleValue> FleetUsageFactorParameter { 76 80 get { return (IValueParameter<DoubleValue>)Parameters["FleetUsageFactor"]; } … … 142 146 Parameters.Add(new ValueParameter<DoubleArray>("VehicleReadyTimes", new DoubleArray())); 143 147 Parameters.Add(new ValueParameter<DoubleArray>("VehicleDueTimes", new DoubleArray())); 148 Parameters.Add(new ValueParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1))); 144 149 Parameters.Add(new ValueParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.", new DoubleValue(3000))); 145 150 Parameters.Add(new ValueParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(10000)));
Note: See TracChangeset
for help on using the changeset viewer.