MATSIM
CostInformation.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *********************************************************************** *
4  * *
5  * copyright : (C) 2019 by the members listed in the COPYING, *
6  * LICENSE and WARRANTY file. *
7  * email : info at matsim dot org *
8  * *
9  * *********************************************************************** *
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * See also COPYING, LICENSE and WARRANTY file *
16  * *
17  * *********************************************************************** */
18 
19 package org.matsim.vehicles;
20 
24 
25 public final class CostInformation implements Attributable{
26 
27  // maybe at least these subtypes should be immutable? kai, aug'19
28  // No, the decision is to rather have the typical matsim data model where this is an object-oriented database in memory, and everything is settable.
29  // kai, sep'19
30 
31  private Double fixed;
32  private Double perMeter;
33  private Double perSecond;
35 
36  /* package-private */ CostInformation() { }
37  public Double getFixedCosts() {
38  return fixed;
39  }
40  public Double getCostsPerMeter() {
41  return perMeter;
42  }
43  public Double getCostsPerSecond() {
44  return perSecond;
45  }
46  @Override public Attributes getAttributes() {
47  return attributes;
48  }
49  public CostInformation setFixedCost( Double fixed ){
50  this.fixed = fixed;
51  return this ;
52  }
53  public CostInformation setCostsPerMeter( Double perMeter ){
54  this.perMeter = perMeter;
55  return this ;
56  }
57  public CostInformation setCostsPerSecond( Double perSecond ){
58  this.perSecond = perSecond;
59  return this ;
60  }
61  @Deprecated // refactoring device, please inline
62  public double getFix() {
63  return getFixedCosts() ;
64  }
65  @Deprecated // refactoring device, please inline
66  public double getPerDistanceUnit() {
67  return getCostsPerMeter() ;
68  }
69  @Deprecated // refactoring device, please inline
70  public double getPerTimeUnit() {
71  return getCostsPerSecond() ;
72  }
73 }
CostInformation setCostsPerSecond(Double perSecond)
CostInformation setCostsPerMeter(Double perMeter)
CostInformation setFixedCost(Double fixed)