AnyLogic
Expand
Font size
Type Parameters:
V - the type of schedule values
U - the type of units used by this schedule
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Serializable

public class ScheduleWithUnits<U extends IUnits<U>>
extends Schedule<Double>
Schedule with units (Time, Rate etc.). For more information, see Schedule.
Usage:
 ScheduleWithUnits<Double, RateUnits> s = new ScheduleWithUnits<Double, RateUnits>(PER_HOUR);
 
 // configure 's': s.setPeriod() etc.
 s.initialize();
 
 double rate = s.getValue(PER_MINUTE);
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
ScheduleSerialized Form

Constructor Summary

ConstructorDescription
ScheduleWithUnits(Utilities owner, boolean calendarType, int firstDayOfWeek, long period, long timeUnits, Long snapTo, Double defaultValue, long[] exStarts, long[] exEnds, Object[] exValues, boolean glueIntervals, boolean[] exceptionsAnnually, boolean singleThreadMode, boolean isLateInit, U units)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
ScheduleWithUnits(Utilities owner, boolean calendarType, int firstDayOfWeek, long period, long timeUnits, Long snapTo, Double defaultValue, long[] starts, long[] ends, Object[] values, boolean glueIntervals, boolean[] exceptionsAnnually, boolean singleThreadMode, U units) 
ScheduleWithUnits(U units) 

Method Summary

Modifier and TypeMethodDescription
DoublegetNextValue(double time, TimeUnits timeUnits, U valueUnits)
Returns the value of the schedule change moment next to the given time.
In case when there is no 'next' value, returns null.
In case of +/-infinity or NaN argument value, returns null
DoublegetNextValue(double time, U units)
Returns the value of the schedule change moment next to the given time.
In case when there is no 'next' value, returns null.
In case of +/-infinity or NaN argument value, returns null
DoublegetNextValue(Date date, U units)
Returns the value of the schedule change moment next to the given model date.
In case when there is no 'next' value, returns null.
In case of null argument value, returns null
DoublegetNextValue(U units)
Returns the value of the next change moment in the schedule.
In case when there is no 'next' value, returns null
UgetUnits()
Returns units used by functions like Schedule.getValue()
DoublegetValue(double time, TimeUnits timeUnits, U valueUnits)
Returns the value of the schedule corresponding to the given time.
In case of +/-infinity or NaN argument value, returns null
DoublegetValue(double time, U units)
Returns the value of the schedule corresponding to the given model time.
In case of +/-infinity or NaN argument value, returns null
DoublegetValue(Date date, U units)
Returns the value of the schedule corresponding to the given model date.
In case of null argument value, returns null
DoublegetValue(U units)
Returns the value corresponding to the current model time

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Details

ScheduleWithUnits

public ScheduleWithUnits(U units)

ScheduleWithUnits

public ScheduleWithUnits(Utilities owner,
 boolean calendarType,
 int firstDayOfWeek,
 long period,
 long timeUnits,
 Long snapTo,
 Double defaultValue,
 long[] starts,
 long[] ends,
 Object[] values,
 boolean glueIntervals,
 boolean[] exceptionsAnnually,
 boolean singleThreadMode,
 U units)

ScheduleWithUnits

@AnyLogicInternalAPI
public ScheduleWithUnits(Utilities owner,
 boolean calendarType,
 int firstDayOfWeek,
 long period,
 long timeUnits,
 Long snapTo,
 Double defaultValue,
 long[] exStarts,
 long[] exEnds,
 Object[] exValues,
 boolean glueIntervals,
 boolean[] exceptionsAnnually,
 boolean singleThreadMode,
 boolean isLateInit,
 U units)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

Method Details

getUnits

public U getUnits()
Returns units used by functions like Schedule.getValue()
Returns:
the units used by functions like Schedule.getValue()

getValue

public Double getValue(U units)
Returns the value corresponding to the current model time
Parameters:
units - the units of value
Returns:
the value corresponding to the current model time

getValue

public Double getValue(double time,
 U units)
Returns the value of the schedule corresponding to the given model time.
In case of +/-infinity or NaN argument value, returns null
Parameters:
time - the model time
units - the units of value
Returns:
the value corresponding to the given model time

getValue

public Double getValue(double time,
 TimeUnits timeUnits,
 U valueUnits)
Returns the value of the schedule corresponding to the given time.
In case of +/-infinity or NaN argument value, returns null
Parameters:
time - the time
timeUnits - the units of time
valueUnits - the units of value
Returns:
the value corresponding to the given time

getValue

public Double getValue(Date date,
 U units)
Returns the value of the schedule corresponding to the given model date.
In case of null argument value, returns null
Parameters:
date - the model date
units - the units of value
Returns:
the value corresponding to the given model date

getNextValue

public Double getNextValue(U units)
Returns the value of the next change moment in the schedule.
In case when there is no 'next' value, returns null
Parameters:
units - the units of value
Returns:
the value of the next schedule change or null

getNextValue

public Double getNextValue(double time,
 U units)
Returns the value of the schedule change moment next to the given time.
In case when there is no 'next' value, returns null.
In case of +/-infinity or NaN argument value, returns null
Parameters:
units - the units of value
Returns:
the value of the schedule change next to the given time or null

getNextValue

public Double getNextValue(double time,
 TimeUnits timeUnits,
 U valueUnits)
Returns the value of the schedule change moment next to the given time.
In case when there is no 'next' value, returns null.
In case of +/-infinity or NaN argument value, returns null
Parameters:
timeUnits - the units of time
valueUnits - the units of value
Returns:
the value of the schedule change next to the given time or null

getNextValue

public Double getNextValue(Date date,
 U units)
Returns the value of the schedule change moment next to the given model date.
In case when there is no 'next' value, returns null.
In case of null argument value, returns null
Parameters:
units - the units of value
Returns:
the value of the schedule change next to the given date or null