source: branches/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Data/CostFactors.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.7 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Parameters;
4using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
5
6namespace HeuristicLab.BioBoost.Data {
7
8  [StorableClass]
9  [Item("CostFactors", "Splits the cost into several differen areas which can are different for different regions.")]
10  public class CostFactors : DataItem {
11
12    #region Parameters
13    public IValueParameter<ValueParameterCollection> InvestmentParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Investment"]; } }
14    public IValueParameter<ValueParameterCollection> LaborParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Labor"]; } }
15    public IValueParameter<ValueParameterCollection> FuelParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Fuel"]; } }
16    public IValueParameter<ValueParameterCollection> MaintenanceParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Maintenance"]; } }
17    public IValueParameter<ValueParameterCollection> OtherParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Other"]; } }
18    #endregion
19
20    #region Parameter Values
21    public ValueParameterCollection Investment { get { return InvestmentParameter.Value; } }
22    public ValueParameterCollection Labor { get { return LaborParameter.Value; } }
23    public ValueParameterCollection Fuel { get { return FuelParameter.Value; } }
24    public ValueParameterCollection Maintenance { get { return MaintenanceParameter.Value; } }
25    public ValueParameterCollection Other { get { return OtherParameter.Value; } }
26    #endregion
27
28    #region Construction & Cloning
29    [StorableConstructor]
30    protected CostFactors(bool isDeserializing) : base(isDeserializing) { }
31
32    protected CostFactors(CostFactors orig, Cloner cloner) : base(orig, cloner) { }
33
34    public CostFactors() {
35      Parameters.Add(new ValueParameter<ValueParameterCollection>("Investment", "The cost factors for investment."));
36      Parameters.Add(new ValueParameter<ValueParameterCollection>("Labor", "The cost factors for labor."));
37      Parameters.Add(new ValueParameter<ValueParameterCollection>("Fuel", "The cost factors for fuel."));
38      Parameters.Add(new ValueParameter<ValueParameterCollection>("Maintenance", "The cost factors for maintenance."));
39      Parameters.Add(new ValueParameter<ValueParameterCollection>("Other", "The cost factors for other costs."));
40    }
41
42    public override IDeepCloneable Clone(Cloner cloner) {
43      return new CostFactors(this, cloner);
44    }
45    #endregion
46
47
48    public override bool IsEquivalentTo(DataItem other) {
49      return true;
50    }
51  }
52}
Note: See TracBrowser for help on using the repository browser.