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, java.io.Serializable

public class ScheduleWithUnits<U extends IUnits<U>>
extends Schedule<java.lang.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:
Schedule, Serialized Form

Constructor Summary

Constructors 
ScheduleWithUnits​(Utilities owner, boolean calendarType, int firstDayOfWeek, long period, long timeUnits, java.lang.Long snapTo, java.lang.Double defaultValue, long[] exStarts, long[] exEnds, java.lang.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, java.lang.Long snapTo, java.lang.Double defaultValue, long[] starts, long[] ends, java.lang.Object[] values, boolean glueIntervals, boolean[] exceptionsAnnually, boolean singleThreadMode, U units)  
ScheduleWithUnits​(U units)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
java.lang.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
java.lang.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
java.lang.Double getNextValue​(java.util.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
java.lang.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
U getUnits()
Returns units used by functions like Schedule.getValue()
java.lang.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
java.lang.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
java.lang.Double getValue​(java.util.Date date, U units)
Returns the value of the schedule corresponding to the given model date.
In case of null argument value, returns null
java.lang.Double getValue​(U units)
Returns the value corresponding to the current model time
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.Schedule

addException, addInterval, addInterval, addInterval, addInterval, addInterval, addMoment, addMoment, addMoment, addMoment, addMoment, getDateOfNextValue, getDateOfNextValue, getDateOfNextValue, getDateOfValue, getDateOfValue, getDateOfValue, getDistinctValues_xjal, getNextValue, getNextValue, getNextValue, getNextValue, getTimeOfNextValue, getTimeOfNextValue, getTimeOfNextValue, getTimeOfValue, getTimeOfValue, getTimeOfValue, getTimeoutToNextValue, getTimeoutToNextValue, getTimeoutToNextValue, getTimeUnits, getValue, getValue, getValue, getValue, initialize, isInitialized, lazyInit, restoreOwner, setCalendarType, setDefaultValue, setFirstDayOfWeek, setGlueIntervals, setOwner, setPeriod, setSingleThreadMode, setSnapTo, setSnapTo, setTimeUnits, toString

Methods inherited from class java.lang.Object

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

Constructor Detail

ScheduleWithUnits

public ScheduleWithUnits​(U units)

ScheduleWithUnits

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

ScheduleWithUnits

@AnyLogicInternalAPI
public ScheduleWithUnits​(Utilities owner,
                         boolean calendarType,
                         int firstDayOfWeek,
                         long period,
                         long timeUnits,
                         java.lang.Long snapTo,
                         java.lang.Double defaultValue,
                         long[] exStarts,
                         long[] exEnds,
                         java.lang.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 Detail

getUnits

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

getValue

public java.lang.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 java.lang.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 java.lang.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 java.lang.Double getValue​(java.util.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 java.lang.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 java.lang.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 java.lang.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 java.lang.Double getNextValue​(java.util.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
How can we improve this article?