Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCreator.cs @ 3947

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

Added CVRP implementation using the Alba encoding (#1039)

File size: 4.2 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 System;
23using System.Collections.Generic;
24using System.Linq;
25using System.Text;
26using HeuristicLab.Operators;
27using HeuristicLab.Core;
28using HeuristicLab.Data;
29using HeuristicLab.Parameters;
30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
31
32namespace HeuristicLab.Problems.VehicleRouting {
33  [StorableClass]
34  public abstract class VRPCreator : SingleSuccessorOperator, IVRPCreator {
35    public override bool CanChangeName {
36      get { return false; }
37    }
38   
39    #region IVRPCreator Members
40    public IValueLookupParameter<IntValue> CitiesParameter {
41      get { return (IValueLookupParameter<IntValue>)Parameters["Cities"]; }
42    }
43    public ILookupParameter<IVRPEncoding> VRPSolutionParameter {
44      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
45    }
46    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
47      get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
48    }
49    public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
50      get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; }
51    }
52    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
53      get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
54    }
55    public ILookupParameter<IntValue> VehiclesParameter {
56      get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; }
57    }
58    public ILookupParameter<DoubleValue> CapacityParameter {
59      get { return (ILookupParameter<DoubleValue>)Parameters["Capacity"]; }
60    }
61    public ILookupParameter<DoubleArray> DemandParameter {
62      get { return (ILookupParameter<DoubleArray>)Parameters["Demand"]; }
63    }
64    public ILookupParameter<DoubleArray> ReadyTimeParameter {
65      get { return (ILookupParameter<DoubleArray>)Parameters["ReadyTime"]; }
66    }
67    public ILookupParameter<DoubleArray> DueTimeParameter {
68      get { return (ILookupParameter<DoubleArray>)Parameters["DueTime"]; }
69    }
70    public ILookupParameter<DoubleArray> ServiceTimeParameter {
71      get { return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; }
72    }
73
74    public VRPCreator()
75      : base() {
76      Parameters.Add(new ValueLookupParameter<IntValue>("Cities", "The city count."));
77      Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The vehicles count."));
78      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates of the cities."));
79      Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
80      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false."));
81      Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle."));
82      Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer."));
83      Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer."));
84      Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer."));
85      Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer."));
86
87      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPSolution", "The new VRP solution."));
88    }
89
90    #endregion
91  }
92}
Note: See TracBrowser for help on using the repository browser.