Free cookie consent management tool by TermsFeed Policy Generator

source: addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Data/LogisticAction.cs @ 17777

Last change on this file since 17777 was 16575, checked in by gkronber, 5 years ago

#2520: changed HeuristicLab.BioBoost addon to compile with new HL.Persistence

File size: 3.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 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.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
25using HeuristicLab.Parameters;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27using HEAL.Attic;
28
29namespace HeuristicLab.BioBoost.Data {
30  [StorableType("413F5F16-3342-46CF-93AF-38FDD4F40E92")]
31  [Item("LogisticAction", "Summarizes cost factors and emissions for a logistic action.")]
32  public class LogisticAction : DataItem {
33
34    #region Parameters
35    public IValueParameter<DoubleValue> InvestmentParameter { get { return (IValueParameter<DoubleValue>)Parameters["Investment"]; } }
36    public IValueParameter<DoubleValue> LaborParameter { get { return (IValueParameter<DoubleValue>)Parameters["Labor"]; } }
37    public IValueParameter<DoubleValue> FuelParameter { get { return (IValueParameter<DoubleValue>)Parameters["Fuel"]; } }
38    public IValueParameter<DoubleValue> MaintenanceParameter { get { return (IValueParameter<DoubleValue>)Parameters["Maintenance"]; } }
39    public IValueParameter<DoubleValue> OtherParameter { get { return (IValueParameter<DoubleValue>)Parameters["Other"]; } }
40    public IValueParameter<ValueParameterCollection> EmissionsParameter {
41      get { return (IValueParameter<ValueParameterCollection>)Parameters["Emissions"]; }
42    }
43    #endregion
44
45    #region Parameter Values
46    public double Investment { get { return InvestmentParameter.Value.Value; } }
47    public double Labor { get { return LaborParameter.Value.Value; } }
48    public double Fuel { get { return FuelParameter.Value.Value; } }
49    public double Maintenance { get { return MaintenanceParameter.Value.Value; } }
50    public double Other { get { return OtherParameter.Value.Value; } set { OtherParameter.Value = new DoubleValue(value); } }
51
52    public ValueParameterCollection Emissions { get { return EmissionsParameter.Value; } }
53    #endregion
54
55    #region Construction & Cloning
56
57    public LogisticAction() {
58      Parameters.Add(new ValueParameter<DoubleValue>("Investment", "The investment cost per unit."));
59      Parameters.Add(new ValueParameter<DoubleValue>("Labor", "The labor cost per unit."));
60      Parameters.Add(new ValueParameter<DoubleValue>("Fuel", "The fuelt cost per unit."));
61      Parameters.Add(new ValueParameter<DoubleValue>("Maintenance", "The maintenance cost per unit."));
62      Parameters.Add(new ValueParameter<DoubleValue>("Other", "other costs per unit."));
63      Parameters.Add(new ValueParameter<ValueParameterCollection>("Emissions", "The set of emission amounts per unit."));
64    }
65
66    [StorableConstructor]
67    protected LogisticAction(StorableConstructorFlag _) : base(_) { }
68
69    protected LogisticAction(LogisticAction orig, Cloner cloner) : base(orig, cloner) { }
70
71    public override IDeepCloneable Clone(Cloner cloner) {
72      return new LogisticAction(this, cloner);
73    }
74
75    #endregion
76
77    public override bool IsEquivalentTo(DataItem other) {
78      return false;
79    }
80  }
81}
Note: See TracBrowser for help on using the repository browser.