source: branches/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Data/LogisticAction.cs @ 13069

Last change on this file since 13069 was 13069, checked in by gkronber, 7 years ago

#2499: imported source code for HeuristicLab.BioBoost from private repository with some changes

File size: 2.9 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Parameters;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6
7namespace HeuristicLab.BioBoost.Data {
8  [StorableClass]
9  [Item("LogisticAction", "Summarizes cost factors and emissions for a logistic action.")]
10  public class LogisticAction : DataItem {
11
12    #region Parameters
13    public IValueParameter<DoubleValue> InvestmentParameter { get { return (IValueParameter<DoubleValue>)Parameters["Investment"]; } }
14    public IValueParameter<DoubleValue> LaborParameter { get { return (IValueParameter<DoubleValue>)Parameters["Labor"]; } }
15    public IValueParameter<DoubleValue> FuelParameter { get { return (IValueParameter<DoubleValue>)Parameters["Fuel"]; } }
16    public IValueParameter<DoubleValue> MaintenanceParameter { get { return (IValueParameter<DoubleValue>)Parameters["Maintenance"]; } }
17    public IValueParameter<DoubleValue> OtherParameter { get { return (IValueParameter<DoubleValue>)Parameters["Other"]; } }
18    public IValueParameter<ValueParameterCollection> EmissionsParameter {
19      get { return (IValueParameter<ValueParameterCollection>)Parameters["Emissions"]; }
20    }
21    #endregion
22
23    #region Parameter Values
24    public double Investment { get { return InvestmentParameter.Value.Value; } }
25    public double Labor { get { return LaborParameter.Value.Value; } }
26    public double Fuel { get { return FuelParameter.Value.Value; } }
27    public double Maintenance { get { return MaintenanceParameter.Value.Value; } }
28    public double Other { get { return OtherParameter.Value.Value; } set { OtherParameter.Value = new DoubleValue(value); } }
29
30    public ValueParameterCollection Emissions { get { return EmissionsParameter.Value; } }
31    #endregion
32
33    #region Construction & Cloning
34
35    public LogisticAction() {
36      Parameters.Add(new ValueParameter<DoubleValue>("Investment", "The investment cost per unit."));
37      Parameters.Add(new ValueParameter<DoubleValue>("Labor", "The labor cost per unit."));
38      Parameters.Add(new ValueParameter<DoubleValue>("Fuel", "The fuelt cost per unit."));
39      Parameters.Add(new ValueParameter<DoubleValue>("Maintenance", "The maintenance cost per unit."));
40      Parameters.Add(new ValueParameter<DoubleValue>("Other", "other costs per unit."));
41      Parameters.Add(new ValueParameter<ValueParameterCollection>("Emissions", "The set of emission amounts per unit."));
42    }
43
44    [StorableConstructor]
45    protected LogisticAction(bool isDeserializing) : base(isDeserializing) { }
46
47    protected LogisticAction(LogisticAction orig, Cloner cloner) : base(orig, cloner) { }
48
49    public override IDeepCloneable Clone(Cloner cloner) {
50      return new LogisticAction(this, cloner);
51    }
52
53    #endregion
54
55    public override bool IsEquivalentTo(DataItem other) {
56      return false;
57    }
58  }
59}
Note: See TracBrowser for help on using the repository browser.