Time-Related System Attributes: Difference between revisions

From Planimate Knowledge Base
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
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). </onlyinclude>  
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). </onlyinclude>  


Name Read / Write Description
----


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


Time of Day (sec) R This attribute gives the time of day in seconds, so its values will range between zero, and 86399.
Read / Write


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.
Description


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.
=== '''AdvanceToTime '''  ===


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.
W


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.  
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.  


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.
<br>


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.
=== '''Clock '''  ===


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.
R  


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.  
This is the current time as indicated in the Simulation Clock.  


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.
<br>


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.
=== Clock'''DayCount '''  ===


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.
R  


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.  
This attribute gives the number of days since the run commenced. The count is set to 1 at the start of the model run.  


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.
<br>


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'''DayOfMonth '''  ===


Clock Visible W Shows/Hides the Simulation Clock.
R


Run In Real Time 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
This attribute gives the date number of the CALENDAR month, as shown in the clock. It does not work in Relative time.  


Time Zone Correction (Minutes) 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 specified manually in the Display-&gt;Time Field Format time dialog or Run Start Date dialog.  
<br>
 
=== '''ClockDayOfWeek '''  ===
 
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.
 
<br>
 
=== Clock'''DaysInMonth '''  ===
 
R
 
This attribute gives the number of days of the current CALENDAR month shown by the clock. It does not work in Relative time.
 
<br>
 
=== Clock'''HourOfDay '''  ===
 
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.
 
<br>
 
=== Clock'''HourOfDay_1 '''  ===
 
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.
 
<br>
 
=== Clock'''MonthCount '''  ===
 
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.
 
<br>
 
=== Clock'''MonthOfYear '''  ===
 
R
 
This attribute gives the month of the year. January is month #1. It does not work in Relative time.
 
<br>
 
=== Clock'''TimeOfDay '''  ===
 
R
 
This attribute gives the time of day in seconds, so its values will range between zero, and 86399.
 
<br>
 
=== '''ClockVisible '''  ===
 
W
 
Shows/Hides the Simulation Clock.
 
<br>
 
=== Clock'''WeekCount '''  ===
 
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.
 
<br>
 
=== Clock'''WeekOfYear '''  ===
 
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.
 
<br>
 
=== Clock'''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.
 
<br>
 
=== '''RunInRealTime '''  ===
 
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
 
<br>
 
=== '''RunStartTimeReference '''  ===
 
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.
 
<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>
 
=== '''SystemRealTime '''  ===
 
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.
 
<br>
 
=== '''SystemRealTimeOfDay '''  ===
 
R
 
Gives the number of seconds that have elapsed since midnight on the current REAL day, as read from the pc clock.
 
<br>
 
=== '''TimeZoneCorrectionMIN '''  ===
 
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-&gt;Time Field Format time dialog or Run Start Date dialog.  
 
<br>


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

Latest revision as of 21:23, 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


AdvanceToTime

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.


Clock

R

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


ClockDayCount

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.


ClockDayOfMonth

R

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


ClockDayOfWeek

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.


ClockDaysInMonth

R

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


ClockHourOfDay

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.


ClockHourOfDay_1

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.


ClockMonthCount

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.


ClockMonthOfYear

R

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


ClockTimeOfDay

R

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


ClockVisible

W

Shows/Hides the Simulation Clock.


ClockWeekCount

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.


ClockWeekOfYear

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.


ClockYear

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.


RunInRealTime

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


RunStartTimeReference

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.


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.


SystemRealTime

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.


SystemRealTimeOfDay

R

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


TimeZoneCorrectionMIN

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.