<?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: Regarding ASRS and decide looping in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595941#M90731</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello! Could you try replacing &lt;/P&gt;
 &lt;PRE&gt;(objectexists(getlabel(token, "DoneItem")))&lt;/PRE&gt;
 &lt;P&gt;by&lt;/P&gt;
 &lt;PRE&gt;(token.DoneItem?)&lt;/PRE&gt;
 &lt;P&gt;Let me know if that works! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 27 Jun 2024 09:19:08 GMT</pubDate>
    <dc:creator>jc_pardo</dc:creator>
    <dc:date>2024-06-27T09:19:08Z</dc:date>
    <item>
      <title>Regarding ASRS and decide looping</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595940#M90730</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 24.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;The way it currently works is boards are taken from the combiner and placed onto the entry queue. The purpose of the entry queue is that it holds the boards, which need to be placed on the racks. We can consider the previous to be Step 1.&lt;/P&gt;
 &lt;P&gt;An ASRS takes a board from the entry queue, one at a time, and places a board onto the testing rack. If a board has been successfully tested, the board's color changes to red. After the board has been tested, it is taken by the same ASRS onto the exit queue.&lt;/P&gt;
 &lt;P&gt;I'm trying to set up the wanted logic, which is:&lt;/P&gt;
 &lt;P&gt;If there are boards waiting to be removed from the rack and placed on the exit queue vs. boards on the entry queue waiting to be placed on the rack, we want to prioritize the boards waiting to be removed from the rack and placed on the exit queue.&lt;/P&gt;
 &lt;P&gt;This is what I have set up right now:&lt;/P&gt;
 &lt;P&gt;A "Decide" block in FlexSim. The Decide block contains some code that makes it decide which output to go to. There are 2 outputs:&lt;/P&gt;
 &lt;P&gt;Output 1: A subflow in which the ASRS takes the tested board to the exit queue.&lt;/P&gt;
 &lt;P&gt;Output 2: A subflow in which the ASRS takes a board from the entry queue into the testing rack.&lt;/P&gt;
 &lt;P&gt;When the board has been tested, it is assigned a token label of "DoneItem" using a source block after a given dwell time and then placed onto a list called "Pallets in POD". &lt;/P&gt;
 &lt;P&gt;Output 2 has an arrow pointing back to the "Decide" block creating a loop to constantly make the ASRS evaluate what to do next.&lt;/P&gt;
 &lt;P&gt;Here's the code I have inside the Decide block:&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;/** Custom Code */&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;Object current = param(1);&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;treenode activity = param(2);&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;Token token = param(3);&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;print("Reached the decide block");&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;// Check if the "DoneItem" label exists on the current token&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;if (objectexists(getlabel(token, "DoneItem"))) {
   &lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt; print("Tested board token exists, returning connector rank 1"); // Debug statement&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt; return 1; // Assuming the connector leading to the "Move to Exit Queue" subflow is ranked 1&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;} else {
   &lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt; print("No tested board token exists, returning connector rank 2"); // Debug statement&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt; return 2; // Assuming the connector leading to the "Move to Testing Rack" subflow is ranked 2&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;This works, in that the ASRS is able to retrieve boards from the entry queue and place them onto the testing rack. However, the code never hits the "if" statement, so the ASRS never takes the boards off of the testing rack and places them onto the exit queue. I'm confused, because when I check the items in the "Pallets in POD" list during the simulation period, there are definitely tokens with the label "DoneItem". &lt;BR /&gt;&lt;BR /&gt;Would really appreciate any help.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Jun 2024 23:47:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595940#M90730</guid>
      <dc:creator>mfrsagfm</dc:creator>
      <dc:date>2024-06-26T23:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ASRS and decide looping</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595941#M90731</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello! Could you try replacing &lt;/P&gt;
 &lt;PRE&gt;(objectexists(getlabel(token, "DoneItem")))&lt;/PRE&gt;
 &lt;P&gt;by&lt;/P&gt;
 &lt;PRE&gt;(token.DoneItem?)&lt;/PRE&gt;
 &lt;P&gt;Let me know if that works! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jun 2024 09:19:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595941#M90731</guid>
      <dc:creator>jc_pardo</dc:creator>
      <dc:date>2024-06-27T09:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ASRS and decide looping</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595942#M90732</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Hi jc,
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Thanks for your reply. I tried that, but it still doesn't seem to be working for me. I know for sure that the decide block is being reached due to the print statement inside it, but it never goes inside the "if" portion, it continually hits the "else", even when there are tested boards complete left on the rack.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jun 2024 16:11:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595942#M90732</guid>
      <dc:creator>mfrsagfm</dc:creator>
      <dc:date>2024-06-27T16:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ASRS and decide looping</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595943#M90733</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;No worries - I figured it out. I changed the "if" condition to:&lt;/P&gt;
 &lt;P&gt;&lt;SPAN class="fr-class-code"&gt;List("List1").entries().length &amp;gt; 0&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;"List1" is the list that the tested boards enter - I made this a global list. The process works now as intended.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jun 2024 17:01:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595943#M90733</guid>
      <dc:creator>mfrsagfm</dc:creator>
      <dc:date>2024-06-27T17:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ASRS and decide looping</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595944#M90734</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/44076/mfrsagfm.html" nodeid="44076"&gt;@mfrsagfm&lt;/A&gt;, was one of jc's or mfrsagfm's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Jul 2024 16:58:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/regarding-asrs-and-decide-looping/m-p/13595944#M90734</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2024-07-03T16:58:32Z</dc:date>
    </item>
  </channel>
</rss>

