EMlab-generation Documentation  1.0
Documentation of the EMLab-Generation model.
GeometricTrend.java
1 package emlab.gen.trend;
2 
3 import org.springframework.data.neo4j.annotation.NodeEntity;
4 
5 import agentspring.simulation.SimulationParameter;
6 import agentspring.trend.Trend;
7 
8 @NodeEntity
9 public class GeometricTrend extends TimeSeriesImpl implements Trend {
10 
11  private double growthRate;
12 
13  @SimulationParameter(label = "Initial Value")
14  private double start;
15 
16  public double getStart() {
17  return start;
18  }
19 
20  public void setStart(double start) {
21  this.start = start;
22  }
23 
24  public double getValue(long time) {
25  return (Math.pow((1 + growthRate), time) * getStart());
26  }
27 
28  public double getGrowthRate() {
29  return growthRate;
30  }
31 
32  public void setGrowthRate(double growthRate) {
33  this.growthRate = growthRate;
34  }
35 
36 }