<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set time variable in model parameter table in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/set-time-variable-in-model-parameter-table/m-p/13571885#M71967</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can read the time when an item entered an object with "getentrytime(object)". I would suggest to store the earliest entry time for each type (for example as labels) on the queue. Start with some huge value, so the entry time would always be in the future. When an item enters, set the label to the minimum of the current time and the current label value.&lt;/P&gt;&lt;PRE&gt;current.EarliestEntry = Math.min(Model.time, current.EarliestEntry)&lt;/PRE&gt;&lt;P&gt;After a batch has exited the queue, reset the label to the starting value and loop through all remaining items, again assigning the minimum value.&lt;/P&gt;&lt;PRE&gt;current.EarliestEntry = Math.min(getentrytime(itemRef), current.EarliestEntry)&lt;/PRE&gt;&lt;P&gt;When the waiting time is needed, you calculate it as the difference between the current model time and the label value.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 21 Feb 2024 12:39:44 GMT</pubDate>
    <dc:creator>moehlmann_fe</dc:creator>
    <dc:date>2024-02-21T12:39:44Z</dc:date>
    <item>
      <title>Set time variable in model parameter table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/set-time-variable-in-model-parameter-table/m-p/13571884#M71966</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.0.16 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi,&lt;/P&gt;
 &lt;P&gt;I'm working on a reinforcement learning project. In my model I have 2 queue, one for the pallets and one for people, both with 5 types of objects. In my observation space, a model parameter table, I have 5 parameters, one for each type, that count how long a whole typology is waiting in the queue in time. A maximum of 25 people of the same type are moved on the pallet. How do I set these time parameters so that they tell me how long they’ve been in the queue and once they’ve been moved to start the timer again in case there are people of the same type or do it when they arrive? &lt;/P&gt;
 &lt;P&gt;To understand better, if I have "red wating time" as a parameter, this will tell me how long red people are waiting to be processed in the queue. Once this happens if there are other red people in the queue the timer starts again, otherwise it will start again when new ones are generated from the source. &lt;/P&gt;
 &lt;P&gt;Thank you for the answer.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Feb 2024 12:01:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/set-time-variable-in-model-parameter-table/m-p/13571884#M71966</guid>
      <dc:creator>Gabri</dc:creator>
      <dc:date>2024-02-21T12:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set time variable in model parameter table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/set-time-variable-in-model-parameter-table/m-p/13571885#M71967</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can read the time when an item entered an object with "getentrytime(object)". I would suggest to store the earliest entry time for each type (for example as labels) on the queue. Start with some huge value, so the entry time would always be in the future. When an item enters, set the label to the minimum of the current time and the current label value.&lt;/P&gt;&lt;PRE&gt;current.EarliestEntry = Math.min(Model.time, current.EarliestEntry)&lt;/PRE&gt;&lt;P&gt;After a batch has exited the queue, reset the label to the starting value and loop through all remaining items, again assigning the minimum value.&lt;/P&gt;&lt;PRE&gt;current.EarliestEntry = Math.min(getentrytime(itemRef), current.EarliestEntry)&lt;/PRE&gt;&lt;P&gt;When the waiting time is needed, you calculate it as the difference between the current model time and the label value.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Feb 2024 12:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/set-time-variable-in-model-parameter-table/m-p/13571885#M71967</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2024-02-21T12:39:44Z</dc:date>
    </item>
  </channel>
</rss>

