<?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: conditional decide based on time range in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515953#M27877</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;FlexScript's DateTime object has an hour property that can be queried to give you the model's current hour of the day. See the documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/22.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html#Property-hour"&gt;FlexScript Class - DateTime (flexsim.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So you can get the model's current hour, then use that in your logic:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: 700; font-family: "&gt;double&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: "&gt;currentHour&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: 700; font-family: "&gt;Model&lt;/SPAN&gt;&lt;SPAN style="color: rgb(95, 99, 100); font-family: "&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(121, 0, 255); font-family: "&gt;dateTime&lt;/SPAN&gt;&lt;SPAN style="color: rgb(95, 99, 100); font-family: "&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(121, 0, 255); font-family: "&gt;hour&lt;/SPAN&gt;&lt;SPAN style="color: rgb(95, 99, 100); font-family: "&gt;;&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;You might check out &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/Reference/Tools/TimeTables/TimeTables.html" target="_blank"&gt;Time Tables&lt;/A&gt; as a way to define shifts, along with behaviors that happen at the start and end of the shifts.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 03 Dec 2021 22:07:34 GMT</pubDate>
    <dc:creator>Ben_WilsonADSK</dc:creator>
    <dc:date>2021-12-03T22:07:34Z</dc:date>
    <item>
      <title>conditional decide based on time range</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515952#M27876</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 21.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I want to check to see if I'm on 1st shift or not. I have a decide and I can do Model.time&amp;lt;x hours but that only works for a day. What would be the syntax to say is time between 8am and 4pm so it works if I run the model a week? Or is there a way to designate shifts?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Dec 2021 20:06:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515952#M27876</guid>
      <dc:creator>amy_milesB7Q7X</dc:creator>
      <dc:date>2021-12-03T20:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: conditional decide based on time range</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515953#M27877</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;FlexScript's DateTime object has an hour property that can be queried to give you the model's current hour of the day. See the documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/22.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html#Property-hour"&gt;FlexScript Class - DateTime (flexsim.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So you can get the model's current hour, then use that in your logic:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: 700; font-family: "&gt;double&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: "&gt;currentHour&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: 700; font-family: "&gt;Model&lt;/SPAN&gt;&lt;SPAN style="color: rgb(95, 99, 100); font-family: "&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(121, 0, 255); font-family: "&gt;dateTime&lt;/SPAN&gt;&lt;SPAN style="color: rgb(95, 99, 100); font-family: "&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(121, 0, 255); font-family: "&gt;hour&lt;/SPAN&gt;&lt;SPAN style="color: rgb(95, 99, 100); font-family: "&gt;;&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;You might check out &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/Reference/Tools/TimeTables/TimeTables.html" target="_blank"&gt;Time Tables&lt;/A&gt; as a way to define shifts, along with behaviors that happen at the start and end of the shifts.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Dec 2021 22:07:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515953#M27877</guid>
      <dc:creator>Ben_WilsonADSK</dc:creator>
      <dc:date>2021-12-03T22:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: conditional decide based on time range</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515954#M27878</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thanks Ben,got it to work, could not find how to say "between" but just discovered the code builder and was able to do &amp;gt; and &amp;lt; using &amp;amp;&amp;amp;.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:24:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/conditional-decide-based-on-time-range/m-p/13515954#M27878</guid>
      <dc:creator>amy_milesB7Q7X</dc:creator>
      <dc:date>2021-12-06T20:24:40Z</dc:date>
    </item>
  </channel>
</rss>

