1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Data;
|
---|
4 | using HeuristicLab.Parameters;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 |
|
---|
7 | namespace 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 | }
|
---|