Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VRPOperator.cs @ 4154

Last change on this file since 4154 was 4154, checked in by svonolfe, 14 years ago

Further improved the VRP design (#1039)

File size: 3.6 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Core;
23using HeuristicLab.Operators;
24using HeuristicLab.Parameters;
25using HeuristicLab.Data;
26
27namespace HeuristicLab.Problems.VehicleRouting {
28  public abstract class VRPOperator : SingleSuccessorOperator, IVRPOperator {
29    public int Cities {
30      get { return CoordinatesParameter.ActualValue.Rows - 1; }
31    }
32    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
33      get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
34    }
35    public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
36      get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; }
37    }
38    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
39      get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
40    }
41    public ILookupParameter<IntValue> VehiclesParameter {
42      get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; }
43    }
44    public ILookupParameter<DoubleValue> CapacityParameter {
45      get { return (ILookupParameter<DoubleValue>)Parameters["Capacity"]; }
46    }
47    public ILookupParameter<DoubleArray> DemandParameter {
48      get { return (ILookupParameter<DoubleArray>)Parameters["Demand"]; }
49    }
50    public ILookupParameter<DoubleArray> ReadyTimeParameter {
51      get { return (ILookupParameter<DoubleArray>)Parameters["ReadyTime"]; }
52    }
53    public ILookupParameter<DoubleArray> DueTimeParameter {
54      get { return (ILookupParameter<DoubleArray>)Parameters["DueTime"]; }
55    }
56    public ILookupParameter<DoubleArray> ServiceTimeParameter {
57      get { return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; }
58    }
59
60    public VRPOperator()
61      : base() {
62      Parameters.Add(new ValueLookupParameter<IntValue>("Cities", "The city count."));
63      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates of the cities."));
64      Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
65      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false."));
66      Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles."));
67      Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle."));
68      Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer."));
69      Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer."));
70      Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer."));
71      Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer."));
72    }
73  }
74}
Note: See TracBrowser for help on using the repository browser.