Time-Related System Attributes: Difference between revisions

From Planimate Knowledge Base
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 14: Line 14:
----
----


'''Clock '''
'''Clock '''  


R  
R  
Line 20: Line 20:
This is the current time as indicated in the Simulation Clock.  
This is the current time as indicated in the Simulation Clock.  


<br>


 
'''Time of Day (sec) '''  
'''Time of Day (sec) '''


R  
R  
Line 28: Line 28:
This attribute gives the time of day in seconds, so its values will range between zero, and 86399.  
This attribute gives the time of day in seconds, so its values will range between zero, and 86399.  


<br>


 
'''Hour of Day (0..23) '''  
'''Hour of Day (0..23) '''


R  
R  
Line 36: Line 36:
This attribute gives the hour of day, beginning at zero, so for example between 1:00 and 2:00 you get a value of 1.  
This attribute gives the hour of day, beginning at zero, so for example between 1:00 and 2:00 you get a value of 1.  


<br>


 
'''Hour of Day +1 (1..24) '''  
'''Hour of Day +1 (1..24) '''


R  
R  
Line 44: Line 44:
This attribute gives the hour of day, beginning at 1, so for example between 1:00 and 2:00 you get a value of 2.  
This attribute gives the hour of day, beginning at 1, so for example between 1:00 and 2:00 you get a value of 2.  


<br>


 
'''Day of Week (1..7) '''  
'''Day of Week (1..7) '''


R  
R  
Line 52: Line 52:
This attribute gives the day of the week, beginning at 1, progressing by 1 every 24 hours and cycling back to 1 after 7 24 hour periods have elapsed. When using relative time, day 1 occurs during the first 24 hours of the model run. When using calendar time, Sunday is day 1, so for example on a Monday you will get a value of 2.  
This attribute gives the day of the week, beginning at 1, progressing by 1 every 24 hours and cycling back to 1 after 7 24 hour periods have elapsed. When using relative time, day 1 occurs during the first 24 hours of the model run. When using calendar time, Sunday is day 1, so for example on a Monday you will get a value of 2.  


<br>


 
'''Day of Month (1..31) '''  
'''Day of Month (1..31) '''


R  
R  
Line 60: Line 60:
This attribute gives the date number of the CALENDAR month, as shown in the clock. It does not work in Relative time.  
This attribute gives the date number of the CALENDAR month, as shown in the clock. It does not work in Relative time.  


<br>


 
'''Week of Year (1..52) '''  
'''Week of Year (1..52) '''


R  
R  
Line 68: Line 68:
CALENDAR time mode gives week within current calendar year. January is month #1. RELATIVE time mode gives # of weeks since start of run (like Week) NB: As far as the system is concerned, Weeks are always measured from Sunday to Saturday, no matter what day the year starts on. Hence for 1997, (1st of Jan was a Wednesday) week 1 will have 4 days, then Sunday (5th of Jan 1997) will be the beginning of week 2.  
CALENDAR time mode gives week within current calendar year. January is month #1. RELATIVE time mode gives # of weeks since start of run (like Week) NB: As far as the system is concerned, Weeks are always measured from Sunday to Saturday, no matter what day the year starts on. Hence for 1997, (1st of Jan was a Wednesday) week 1 will have 4 days, then Sunday (5th of Jan 1997) will be the beginning of week 2.  


<br>


 
'''Month of Year (1..12) '''  
'''Month of Year (1..12) '''


R  
R  
Line 76: Line 76:
This attribute gives the month of the year. January is month #1. It does not work in Relative time.  
This attribute gives the month of the year. January is month #1. It does not work in Relative time.  


<br>


 
'''Days in Month (1..31) '''  
'''Days in Month (1..31) '''


R  
R  
Line 84: Line 84:
This attribute gives the number of days of the current CALENDAR month shown by the clock. It does not work in Relative time.  
This attribute gives the number of days of the current CALENDAR month shown by the clock. It does not work in Relative time.  


<br>


 
'''Day Count '''  
'''Day Count '''


R  
R  
Line 92: Line 92:
This attribute gives the number of days since the run commenced. The count is set to 1 at the start of the model run.  
This attribute gives the number of days since the run commenced. The count is set to 1 at the start of the model run.  


<br>


 
'''Week Count '''  
'''Week Count '''


R  
R  
Line 100: Line 100:
This attribute gives the number of weeks since the run commenced. The count is set to 1 at the start of the model run.  
This attribute gives the number of weeks since the run commenced. The count is set to 1 at the start of the model run.  


<br>


 
'''Month Count '''  
'''Month Count '''


R  
R  
Line 108: Line 108:
This attribute gives the number of months since the run commenced. The count is set to 1 at the start of the model run. In relative time, there are 30 days in each month. In calendar time the correct days per month is applied.  
This attribute gives the number of months since the run commenced. The count is set to 1 at the start of the model run. In relative time, there are 30 days in each month. In calendar time the correct days per month is applied.  


<br>


 
'''Year '''  
'''Year '''


R  
R  
Line 116: Line 116:
This attribute gives the current CALENDAR YEAR shown by the clock. In Relative time mode, the elapsed year, 1..n, where 1 year = 12 x 30 Days.  
This attribute gives the current CALENDAR YEAR shown by the clock. In Relative time mode, the elapsed year, 1..n, where 1 year = 12 x 30 Days.  


<br>


 
'''System Real Time '''  
'''System Real Time '''


R  
R  
Line 124: Line 124:
This attribute reads your computer’s real time clock, and translates the real calendar time into a Planimate® time offset. This enables you to do things with your models that make reference to the real time environment. Say you have a InterDyne that requires that the data update itself each time it is run, based on information drawn from other software systems. You can import this data, and then check dates against the real time clock to remove any out-of-date records.  
This attribute reads your computer’s real time clock, and translates the real calendar time into a Planimate® time offset. This enables you to do things with your models that make reference to the real time environment. Say you have a InterDyne that requires that the data update itself each time it is run, based on information drawn from other software systems. You can import this data, and then check dates against the real time clock to remove any out-of-date records.  


<br>


 
'''System Real Time Of Day '''  
'''System Real Time Of Day '''


R  
R  
Line 132: Line 132:
Gives the number of seconds that have elapsed since midnight on the current REAL day, as read from the pc clock.  
Gives the number of seconds that have elapsed since midnight on the current REAL day, as read from the pc clock.  


<br>


 
'''Advance To Time '''  
'''Advance To Time '''


W  
W  
Line 140: Line 140:
To initiate/stop a fast advancement. This can be used in conjunction with the System Real Time attribute, to advance a model so that its simulation date corresponds with the current calendar date/time. Or, you might advance an interactive model by a specific time, to avoid delays due to excessive animation between key points in the model run. This is useful for demonstration models.  
To initiate/stop a fast advancement. This can be used in conjunction with the System Real Time attribute, to advance a model so that its simulation date corresponds with the current calendar date/time. Or, you might advance an interactive model by a specific time, to avoid delays due to excessive animation between key points in the model run. This is useful for demonstration models.  


<br>


 
'''Run Start Time Reference '''  
'''Run Start Time Reference '''


R/W  
R/W  
Line 148: Line 148:
This enables the model to reset its Run Start Time. Doing so forces a restart of a model; so invoke with care! Again this may be used in conjunction with the System Real Time Attribute, to keep models “up-to-date” continuously, without having to get the user to manually update this item in the Menu Bar. This has application in the area of “Live” Initialization of models, using imported external data.  
This enables the model to reset its Run Start Time. Doing so forces a restart of a model; so invoke with care! Again this may be used in conjunction with the System Real Time Attribute, to keep models “up-to-date” continuously, without having to get the user to manually update this item in the Menu Bar. This has application in the area of “Live” Initialization of models, using imported external data.  


<br>


 
'''Clock Visible '''  
'''Clock Visible '''


W  
W  
Line 156: Line 156:
Shows/Hides the Simulation Clock.  
Shows/Hides the Simulation Clock.  


<br>


'''Run In Real Time '''


'''Run In Real Time '''
W  
 
W


Can be used to turn on and off the real-time run mode of the engine (where the clock gets stepped along by the real-time clock) Note on the Real-time Mode: Real-time mode involves sending a "continue" message to the engine 2 times a second. A model can use the "_Run Continue" broadcast to capture this event and perform a "background" task. This task/thread will be executed even if the user is editing a cell/attribute. It must not perform any time consuming activity and must not generate a dialog. It should be heavily validated to ensure the real-time task will not stop the model with a message under any circumstance. Run real-time mode is transparent in operation and does not present the "pause" run menu when processing a real-time update  
Can be used to turn on and off the real-time run mode of the engine (where the clock gets stepped along by the real-time clock) Note on the Real-time Mode: Real-time mode involves sending a "continue" message to the engine 2 times a second. A model can use the "_Run Continue" broadcast to capture this event and perform a "background" task. This task/thread will be executed even if the user is editing a cell/attribute. It must not perform any time consuming activity and must not generate a dialog. It should be heavily validated to ensure the real-time task will not stop the model with a message under any circumstance. Run real-time mode is transparent in operation and does not present the "pause" run menu when processing a real-time update  


<br>


'''Time Zone Correction (Minutes) '''


'''Time Zone Correction (Minutes) '''
R/W  
 
R/W


Used to adjust calendar times for the local time zone. The idea is that the internal calendar times/offsets are set in UTC then this variable can be used to shift the displayed (and entered) times from UTC to the local time zone.  
Used to adjust calendar times for the local time zone. The idea is that the internal calendar times/offsets are set in UTC then this variable can be used to shift the displayed (and entered) times from UTC to the local time zone.  
Line 182: Line 182:
TimeZone can be separately specified manually in the Display-&gt;Time Field Format time dialog or Run Start Date dialog.  
TimeZone can be separately specified manually in the Display-&gt;Time Field Format time dialog or Run Start Date dialog.  


<br>
'''SystemMultiMediaTimer'''<br>
R
System attribute returns windows multimedia timer.
The value is in milliseconds with 1 ms accuracy, useful for profiling.
Note this value wraps to 0 when it reaches 2^32 (about every 50 days.<br>


<br>


[[Category:Attribute]] [[Category:Runtime_Engine]] [[Category:Routine]]
[[Category:Attribute]] [[Category:Runtime_Engine]] [[Category:Routine]]

Revision as of 16:27, 14 December 2008

Time-Related System Attributes

These attributes cover pretty much all there is to know about both simulation time (i.e. within the Model during a run), and real time (i.e. the time at which you are running your model).


Name

Read / Write

Description


Clock

R

This is the current time as indicated in the Simulation Clock.


Time of Day (sec)

R

This attribute gives the time of day in seconds, so its values will range between zero, and 86399.


Hour of Day (0..23)

R

This attribute gives the hour of day, beginning at zero, so for example between 1:00 and 2:00 you get a value of 1.


Hour of Day +1 (1..24)

R

This attribute gives the hour of day, beginning at 1, so for example between 1:00 and 2:00 you get a value of 2.


Day of Week (1..7)

R

This attribute gives the day of the week, beginning at 1, progressing by 1 every 24 hours and cycling back to 1 after 7 24 hour periods have elapsed. When using relative time, day 1 occurs during the first 24 hours of the model run. When using calendar time, Sunday is day 1, so for example on a Monday you will get a value of 2.


Day of Month (1..31)

R

This attribute gives the date number of the CALENDAR month, as shown in the clock. It does not work in Relative time.


Week of Year (1..52)

R

CALENDAR time mode gives week within current calendar year. January is month #1. RELATIVE time mode gives # of weeks since start of run (like Week) NB: As far as the system is concerned, Weeks are always measured from Sunday to Saturday, no matter what day the year starts on. Hence for 1997, (1st of Jan was a Wednesday) week 1 will have 4 days, then Sunday (5th of Jan 1997) will be the beginning of week 2.


Month of Year (1..12)

R

This attribute gives the month of the year. January is month #1. It does not work in Relative time.


Days in Month (1..31)

R

This attribute gives the number of days of the current CALENDAR month shown by the clock. It does not work in Relative time.


Day Count

R

This attribute gives the number of days since the run commenced. The count is set to 1 at the start of the model run.


Week Count

R

This attribute gives the number of weeks since the run commenced. The count is set to 1 at the start of the model run.


Month Count

R

This attribute gives the number of months since the run commenced. The count is set to 1 at the start of the model run. In relative time, there are 30 days in each month. In calendar time the correct days per month is applied.


Year

R

This attribute gives the current CALENDAR YEAR shown by the clock. In Relative time mode, the elapsed year, 1..n, where 1 year = 12 x 30 Days.


System Real Time

R

This attribute reads your computer’s real time clock, and translates the real calendar time into a Planimate® time offset. This enables you to do things with your models that make reference to the real time environment. Say you have a InterDyne that requires that the data update itself each time it is run, based on information drawn from other software systems. You can import this data, and then check dates against the real time clock to remove any out-of-date records.


System Real Time Of Day

R

Gives the number of seconds that have elapsed since midnight on the current REAL day, as read from the pc clock.


Advance To Time

W

To initiate/stop a fast advancement. This can be used in conjunction with the System Real Time attribute, to advance a model so that its simulation date corresponds with the current calendar date/time. Or, you might advance an interactive model by a specific time, to avoid delays due to excessive animation between key points in the model run. This is useful for demonstration models.


Run Start Time Reference

R/W

This enables the model to reset its Run Start Time. Doing so forces a restart of a model; so invoke with care! Again this may be used in conjunction with the System Real Time Attribute, to keep models “up-to-date” continuously, without having to get the user to manually update this item in the Menu Bar. This has application in the area of “Live” Initialization of models, using imported external data.


Clock Visible

W

Shows/Hides the Simulation Clock.


Run In Real Time

W

Can be used to turn on and off the real-time run mode of the engine (where the clock gets stepped along by the real-time clock) Note on the Real-time Mode: Real-time mode involves sending a "continue" message to the engine 2 times a second. A model can use the "_Run Continue" broadcast to capture this event and perform a "background" task. This task/thread will be executed even if the user is editing a cell/attribute. It must not perform any time consuming activity and must not generate a dialog. It should be heavily validated to ensure the real-time task will not stop the model with a message under any circumstance. Run real-time mode is transparent in operation and does not present the "pause" run menu when processing a real-time update


Time Zone Correction (Minutes)

R/W

Used to adjust calendar times for the local time zone. The idea is that the internal calendar times/offsets are set in UTC then this variable can be used to shift the displayed (and entered) times from UTC to the local time zone.

The value can be changed during a run, upon the next redraw all table and item calendar times will be displayed with the new offset.

NOTE: The internal value does NOT change, its an offset applied at the TimeToString and StringToTime level.

Example Values: +570 (Adelaide Time), +630 (Adelaide Daylight Time)

NOTE: If importing data or reading TCP/IP tuples with formatted times, then the current TimeZone will be applied in converting the times to seconds from the current time reference that the model stores internally.

TimeZone can be separately specified manually in the Display->Time Field Format time dialog or Run Start Date dialog.


SystemMultiMediaTimer

R

System attribute returns windows multimedia timer.

The value is in milliseconds with 1 ms accuracy, useful for profiling.

Note this value wraps to 0 when it reaches 2^32 (about every 50 days.