MATSIM
Public Member Functions | Private Attributes | List of all members
org.matsim.counts.CountSimComparisonImpl Class Reference
Inheritance diagram for org.matsim.counts.CountSimComparisonImpl:
Inheritance graph
[legend]

Public Member Functions

 CountSimComparisonImpl (final Id< Link > id, final int hour, final double countValue, final double simValue)
 
 CountSimComparisonImpl (final Id< Link > id, final String csId, final int hour, final double countValue, final double simValue)
 
String getCsId ()
 
double calculateRelativeError ()
 
double getCountValue ()
 
int getHour ()
 
Id< LinkgetId ()
 
double getSimulationValue ()
 
double calculateNormalizedRelativeError ()
 
double calculateGEHValue ()
 

Private Attributes

final int hour
 
final double countValue
 
final Id< Linkid
 
final String csId
 

Detailed Description

Implementation of the CountSimComparison Interface.

Author
dgrether

Definition at line 31 of file CountSimComparisonImpl.java.

Constructor & Destructor Documentation

◆ CountSimComparisonImpl() [1/2]

org.matsim.counts.CountSimComparisonImpl.CountSimComparisonImpl ( final Id< Link id,
final int  hour,
final double  countValue,
final double  simValue 
)

◆ CountSimComparisonImpl() [2/2]

org.matsim.counts.CountSimComparisonImpl.CountSimComparisonImpl ( final Id< Link id,
final String  csId,
final int  hour,
final double  countValue,
final double  simValue 
)

Member Function Documentation

◆ getCsId()

String org.matsim.counts.CountSimComparisonImpl.getCsId ( )
Returns
The Id of the count station

Implements org.matsim.counts.CountSimComparison< T >.

Definition at line 80 of file CountSimComparisonImpl.java.

References org.matsim.counts.CountSimComparisonImpl.csId.

80  {
81  return this.csId;
82  }

◆ calculateRelativeError()

double org.matsim.counts.CountSimComparisonImpl.calculateRelativeError ( )
See also
org.matsim.counts.CountSimComparison::calculateRelativeError()
Returns
signed relative error

Implements org.matsim.counts.CountSimComparison< T >.

Definition at line 89 of file CountSimComparisonImpl.java.

References org.matsim.counts.CountSimComparisonImpl.getCountValue(), and org.matsim.counts.CountSimComparisonImpl.getSimulationValue().

89  {
90  double count = this.getCountValue();
91  double sim = this.getSimulationValue();
92  if (count > 0) {
93  return Math.min((sim - count) / count, 1000d);
94  }
95  if (sim > 0) {
96  return 1000d;
97  }
98  return 0;
99  }
Here is the call graph for this function:

◆ getCountValue()

double org.matsim.counts.CountSimComparisonImpl.getCountValue ( )

◆ getHour()

int org.matsim.counts.CountSimComparisonImpl.getHour ( )

◆ getId()

Id<Link> org.matsim.counts.CountSimComparisonImpl.getId ( )

◆ getSimulationValue()

double org.matsim.counts.CountSimComparisonImpl.getSimulationValue ( )

◆ calculateNormalizedRelativeError()

double org.matsim.counts.CountSimComparisonImpl.calculateNormalizedRelativeError ( )
See also
org.matsim.counts.CountSimComparison::calculateNormalizedRelativeError()
Returns
normalized relative error

Implements org.matsim.counts.CountSimComparison< T >.

Definition at line 138 of file CountSimComparisonImpl.java.

138  {
139  final double max = Math.max(this.simulationValue, this.countValue);
140  if (max == 0.0) return 0;
141  return Math.abs(this.simulationValue - this.countValue) / max;
142  }

◆ calculateGEHValue()

double org.matsim.counts.CountSimComparisonImpl.calculateGEHValue ( )
See also
org.matsim.counts.CountSimComparison::calculateGEHValue()

Implements org.matsim.counts.CountSimComparison< T >.

Definition at line 148 of file CountSimComparisonImpl.java.

References org.matsim.counts.CountSimComparisonImpl.countValue.

148  {
149  final double diff = this.simulationValue - this.countValue;
150  final double sum = this.simulationValue + this.countValue;
151  final double gehV = Math.sqrt(2 * diff * diff / sum);
152  return gehV;
153  }

Member Data Documentation

◆ hour

final int org.matsim.counts.CountSimComparisonImpl.hour
private

Attributes holding the data stored by this class

Definition at line 35 of file CountSimComparisonImpl.java.

Referenced by org.matsim.counts.CountSimComparisonImpl.CountSimComparisonImpl(), and org.matsim.counts.CountSimComparisonImpl.getHour().

◆ countValue

final double org.matsim.counts.CountSimComparisonImpl.countValue
private

◆ id

final Id<Link> org.matsim.counts.CountSimComparisonImpl.id
private

◆ csId

final String org.matsim.counts.CountSimComparisonImpl.csId
private

The documentation for this class was generated from the following file: