public interface TimeDiscretization extends Iterable<Double>
Modifier and Type | Method and Description |
---|---|
ArrayList<Double> |
getAsArrayList()
Return a clone of this time discretization as
ArrayList<Double> . |
double[] |
getAsDoubleArray()
Return a clone of this time discretization as
double[] . |
int |
getNumberOfTimes() |
int |
getNumberOfTimeSteps() |
double |
getTickSize()
Returns the smallest time span distinguishable in this time discretization.
|
double |
getTime(int timeIndex)
Returns the time for the given time index.
|
int |
getTimeIndex(double time)
Returns the time index for the given time.
|
int |
getTimeIndexNearestGreaterOrEqual(double time)
Returns the time index for the time in the time discretization which is the nearest
to the given time, being greater or equal (i.e. min(i : timeDiscretizationFromArray[i] ≥ time
where timeDiscretizationFromArray[i] ≤ timeDiscretizationFromArray[j]).
|
int |
getTimeIndexNearestLessOrEqual(double time)
Returns the time index for the time in the time discretization which is the nearest
to the given time, being less or equal (i.e. max(i : timeDiscretizationFromArray[i] ≤ time
where timeDiscretizationFromArray[i] ≤ timeDiscretizationFromArray[j]).
|
TimeDiscretization |
getTimeShiftedTimeDiscretization(double timeShift)
Return a new time discretization where all time points have been shifted by
a given time shift.
|
double |
getTimeStep(int timeIndex)
Returns the time step from the given time index to the next one.
|
TimeDiscretization |
intersect(TimeDiscretization that)
Returns the intersection of this time discretization with another one.
|
TimeDiscretization |
union(TimeDiscretization that)
Returns the union of this time discretization with another one.
|
forEach, iterator, spliterator
int getNumberOfTimes()
int getNumberOfTimeSteps()
double getTime(int timeIndex)
timeIndex
- Time indexdouble getTimeStep(int timeIndex)
timeIndex
- Time indexint getTimeIndex(double time)
time
- The time.int getTimeIndexNearestLessOrEqual(double time)
time
- Given time.int getTimeIndexNearestGreaterOrEqual(double time)
time
- Given time.double[] getAsDoubleArray()
double[]
.double[]
ArrayList<Double> getAsArrayList()
ArrayList<Double>
.
Note that this method is costly in terms of performance.ArrayList<Double>
TimeDiscretization getTimeShiftedTimeDiscretization(double timeShift)
timeShift
- A time shift applied to all discretization points.TimeDiscretization union(TimeDiscretization that)
a.intersect(a.union(b))
might not be equal to a
.that
- Another time discretization containing points to add to the time discretization.TimeDiscretization intersect(TimeDiscretization that)
a.intersect(a.union(b))
might not be equal to a
.that
- Another time discretization containing points to add to the time discretization.double getTickSize()
Copyright © 2020. All rights reserved.