Free cookie consent management tool by TermsFeed Policy Generator

source: addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Data/CostFactors.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.6 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.Parameters;
25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
26using HEAL.Attic;
27
28namespace HeuristicLab.BioBoost.Data {
29
30  [StorableType("137AF95F-D154-4EF3-B522-C50BF477A926")]
31  [Item("CostFactors", "Splits the cost into several differen areas which can are different for different regions.")]
32  public class CostFactors : DataItem {
33
34    #region Parameters
35    public IValueParameter<ValueParameterCollection> InvestmentParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Investment"]; } }
36    public IValueParameter<ValueParameterCollection> LaborParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Labor"]; } }
37    public IValueParameter<ValueParameterCollection> FuelParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Fuel"]; } }
38    public IValueParameter<ValueParameterCollection> MaintenanceParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Maintenance"]; } }
39    public IValueParameter<ValueParameterCollection> OtherParameter { get { return (IValueParameter<ValueParameterCollection>)Parameters["Other"]; } }
40    #endregion
41
42    #region Parameter Values
43    public ValueParameterCollection Investment { get { return InvestmentParameter.Value; } }
44    public ValueParameterCollection Labor { get { return LaborParameter.Value; } }
45    public ValueParameterCollection Fuel { get { return FuelParameter.Value; } }
46    public ValueParameterCollection Maintenance { get { return MaintenanceParameter.Value; } }
47    public ValueParameterCollection Other { get { return OtherParameter.Value; } }
48    #endregion
49
50    #region Construction & Cloning
51    [StorableConstructor]
52    protected CostFactors(StorableConstructorFlag _) : base(_) { }
53
54    protected CostFactors(CostFactors orig, Cloner cloner) : base(orig, cloner) { }
55
56    public CostFactors() {
57      Parameters.Add(new ValueParameter<ValueParameterCollection>("Investment", "The cost factors for investment."));
58      Parameters.Add(new ValueParameter<ValueParameterCollection>("Labor", "The cost factors for labor."));
59      Parameters.Add(new ValueParameter<ValueParameterCollection>("Fuel", "The cost factors for fuel."));
60      Parameters.Add(new ValueParameter<ValueParameterCollection>("Maintenance", "The cost factors for maintenance."));
61      Parameters.Add(new ValueParameter<ValueParameterCollection>("Other", "The cost factors for other costs."));
62    }
63
64    public override IDeepCloneable Clone(Cloner cloner) {
65      return new CostFactors(this, cloner);
66    }
67    #endregion
68
69
70    public override bool IsEquivalentTo(DataItem other) {
71      return true;
72    }
73  }
74}
Note: See TracBrowser for help on using the repository browser.