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 22: Line 22:
<br>  
<br>  


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


R  
R  
Line 30: Line 30:
<br>  
<br>  


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


R  
R  
Line 38: Line 38:
<br>  
<br>  


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


R  
R  
Line 46: Line 46:
<br>  
<br>  


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


R  
R  
Line 54: Line 54:
<br>  
<br>  


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


R  
R  
Line 62: Line 62:
<br>  
<br>  


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


R  
R  
Line 70: Line 70:
<br>  
<br>  


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


R  
R  
Line 78: Line 78:
<br>  
<br>  


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


R  
R  
Line 86: Line 86:
<br>  
<br>  


'''Day Count '''  
=== '''Day Count ''' ===


R  
R  
Line 94: Line 94:
<br>  
<br>  


'''Week Count '''  
=== '''Week Count ''' ===


R  
R  
Line 102: Line 102:
<br>  
<br>  


'''Month Count '''  
=== '''Month Count ''' ===


R  
R  
Line 110: Line 110:
<br>  
<br>  


'''Year '''  
=== '''Year ''' ===


R  
R  
Line 118: Line 118:
<br>  
<br>  


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


R  
R  
Line 126: Line 126:
<br>  
<br>  


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


R  
R  
Line 134: Line 134:
<br>  
<br>  


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


W  
W  
Line 142: Line 142:
<br>  
<br>  


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


R/W  
R/W  
Line 150: Line 150:
<br>  
<br>  


'''Clock Visible '''  
=== '''Clock Visible ''' ===


W  
W  
Line 158: Line 158:
<br>  
<br>  


'''Run In Real Time '''  
=== '''Run In Real Time ''' ===


W  
W  
Line 166: Line 166:
<br>  
<br>  


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


R/W  
R/W  
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>
<br>  


'''SystemMultiMediaTimer'''<br>
=== '''SystemMultiMediaTimer'''<br> ===


R
R  


System attribute returns windows multimedia timer.  
System attribute returns windows multimedia timer.  


The value is in milliseconds with 1 ms accuracy, useful for profiling.
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>
Note this value wraps to 0 when it reaches 2^32 (about every 50 days.<br>  


<br>
<br>  


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

Revision as of 21:03, 4 January 2009

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.