<?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 How to find the best transportation route in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13838634#M98352</link>
    <description>&lt;P&gt;Hello everyone, I am currently practicing how to find the best transportation route.&lt;BR /&gt;My goal is to determine the optimal route that achieves the shortest total distance, while keeping the quantity of goods delivered to each warehouse the same. At present, the model still follows the original transportation plan.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have already applied this model&amp;nbsp; (routeoptimizationdemo-1_1_autosave) including the configuration of Parameters and the ProcessFlow, but it has not yet worked successfully. Therefore, I would like to ask for your advice on how to correctly configure the Parameters and ProcessFlow for finding the best transportation route. The figure below shows my current setup, and I have also attached my model (AR2.1)&amp;nbsp;&lt;SPAN&gt;for reference .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-06 145404.png" style="width: 750px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1576479iDED7DE1DA80BE5CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-06 145404.png" alt="Screenshot 2025-10-06 145404.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-06 145438.png" style="width: 796px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1576477i8B254A7A9FDB6B31/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-06 145438.png" alt="Screenshot 2025-10-06 145438.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-06 145445.png" style="width: 812px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1576478iA450D04425CE8B66/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-06 145445.png" alt="Screenshot 2025-10-06 145445.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Oct 2025 08:16:07 GMT</pubDate>
    <dc:creator>dulika_tookta</dc:creator>
    <dc:date>2025-10-06T08:16:07Z</dc:date>
    <item>
      <title>How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13838634#M98352</link>
      <description>&lt;P&gt;Hello everyone, I am currently practicing how to find the best transportation route.&lt;BR /&gt;My goal is to determine the optimal route that achieves the shortest total distance, while keeping the quantity of goods delivered to each warehouse the same. At present, the model still follows the original transportation plan.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have already applied this model&amp;nbsp; (routeoptimizationdemo-1_1_autosave) including the configuration of Parameters and the ProcessFlow, but it has not yet worked successfully. Therefore, I would like to ask for your advice on how to correctly configure the Parameters and ProcessFlow for finding the best transportation route. The figure below shows my current setup, and I have also attached my model (AR2.1)&amp;nbsp;&lt;SPAN&gt;for reference .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-06 145404.png" style="width: 750px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1576479iDED7DE1DA80BE5CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-06 145404.png" alt="Screenshot 2025-10-06 145404.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-06 145438.png" style="width: 796px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1576477i8B254A7A9FDB6B31/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-06 145438.png" alt="Screenshot 2025-10-06 145438.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-06 145445.png" style="width: 812px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1576478iA450D04425CE8B66/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-06 145445.png" alt="Screenshot 2025-10-06 145445.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 08:16:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13838634#M98352</guid>
      <dc:creator>dulika_tookta</dc:creator>
      <dc:date>2025-10-06T08:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13843433#M98407</link>
      <description>&lt;P&gt;Your "Tasks" table seems to define tours for the trucks. Do you want to alter the order of these tours but keep the trips within the same or can the order be changed completely?&lt;/P&gt;&lt;P&gt;In the first case it would probably suffice to use the task table as the base and create the actual table is used during the model run by creating a copy of the table but with the order of the rows adhering to the sequence parameter.&lt;/P&gt;&lt;P&gt;In the second case the first thing you should do is build a solid data framework. Meaning extract the number of trips that should be made between each location pair and store that as a new table. I would then push all of these onto a list of available tasks. Each time a truck becomes idle it would then pull a new trip from the list. One approach could then be to calculate a 'score' for each trip that depends on the distance to the starting point, the number of trips still open that originate from the same start point and the number of trips that are still open at its end point. Each of these would be weighted by some factor given through parameters that can then be altered by the optimizer to try and find a good solution.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 13:18:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13843433#M98407</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2025-10-08T13:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13871122#M98734</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello ,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I would like to ask for advice on setting parameters for &lt;STRONG&gt;Reinforcement Learning (RL)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;In my simulation model, there are &lt;STRONG&gt;13 warehouses&lt;/STRONG&gt; and &lt;STRONG&gt;5 trucks&lt;/STRONG&gt;. The trucks are randomly assigned to follow predefined routes listed in the &lt;EM&gt;Global Table (task list)&lt;/EM&gt;. The goal of this RL experiment is to &lt;STRONG&gt;find transportation routes that minimize total travel distance and time&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I would like your suggestions on how to set the parameters properly:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Observation Parameters:&lt;/STRONG&gt; current truck position, remaining load quantity, and warehouses that have not yet been visited.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Action Parameters:&lt;/STRONG&gt; selecting the next warehouse to deliver to and determining the sequence of travel routes — for example, choosing the next warehouse such as &lt;EM&gt;W1 → W5&lt;/EM&gt; or &lt;EM&gt;W8&lt;/EM&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Reward Function:&lt;/STRONG&gt; the agent receives higher rewards when total travel distance and travel time are reduced.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Goal:&amp;nbsp;&lt;/STRONG&gt;To generate a new &lt;STRONG&gt;routing plan&lt;/STRONG&gt; that minimizes total distance and time, ensuring that all five trucks complete deliveries to all warehouses with the &lt;STRONG&gt;shortest possible total distance&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I have attached the simulation model that I previously tested. However, the RL part still encounters issues in parameter settings and has not yet worked successfully. I would greatly appreciate your advice.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-29 131541.png" style="width: 765px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1582968iC8D4304E2C4CBF48/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-29 131541.png" alt="Screenshot 2025-10-29 131541.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-29 131600.png" style="width: 757px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1582967i3797DC01452D6FF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-29 131600.png" alt="Screenshot 2025-10-29 131600.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-10-29 131609.png" style="width: 775px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1582969iAF3AC4194A80B297/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-10-29 131609.png" alt="Screenshot 2025-10-29 131609.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 06:17:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13871122#M98734</guid>
      <dc:creator>dulika_tookta</dc:creator>
      <dc:date>2025-10-29T06:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13871726#M98749</link>
      <description>&lt;P&gt;You haven't really (at least not explicitly) answered my initial question. How can the trips be varied. Does each truck follow the route defined by a row completely and then chooses a new row/route? Or does it choose where to go next each it arrives at a location?&lt;/P&gt;&lt;P&gt;And to be honest: With my limited experience with the topic, I doubt that using RL is the best approach to achieve better routing. It's probably possible but will take a long time. You will get good results faster by using a deterministic approach, liked I proposed in my initial answer.&lt;/P&gt;&lt;P&gt;You can also look at using external tools like Google's OR Tools to find a solution. Anthony Johnson, one of the FlexSim Devs, posted a concept model about this topic.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/flexsim-knowledge-base/optimized-agv-dispatching-with-google-or-tools/ta-p/13550560" target="_blank"&gt;https://forums.autodesk.com/t5/flexsim-knowledge-base/optimized-agv-dispatching-with-google-or-tools/ta-p/13550560&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.google.com/optimization/routing/vrp" target="_blank"&gt;https://developers.google.com/optimization/routing/vrp&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 13:18:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13871726#M98749</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2025-10-29T13:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13871898#M98755</link>
      <description>&lt;P&gt;&lt;STRONG&gt;I’m sorry for the unclear explanation earlier.&lt;/STRONG&gt;&lt;BR /&gt;My “Task” table defines the transportation routes for the trucks. What I want to do is &lt;STRONG&gt;change the sequence of these delivery routes within each row&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Original route: &lt;STRONG&gt;W1 → W2 → W3&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;New route (reordered): &lt;STRONG&gt;W2 → W3 → W1&lt;/STRONG&gt;,&lt;BR /&gt;which results in shorter travel time and distance.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Goal:&lt;/STRONG&gt;&lt;BR /&gt;To create a &lt;STRONG&gt;new routing plan&lt;/STRONG&gt; that minimizes the &lt;STRONG&gt;total travel distance and time&lt;/STRONG&gt; of all five trucks, while still ensuring that all warehouses are fully served.&lt;/P&gt;&lt;P&gt;I would like your advice on how to set the parameters appropriately.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 14:42:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13871898#M98755</guid>
      <dc:creator>dulika_tookta</dc:creator>
      <dc:date>2025-10-29T14:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13873721#M98767</link>
      <description>&lt;P&gt;My approach for using RL here would be to extract an array of all trips within a route/row when a truck starts it. At the start and after each delivery a decision request is made. The observations would be the current position of the truck, how many eligible trips are left and one parameter for each of those that encodes the start and end location (numbers 1-13 would mean start at 1 and end at 1, 2, 3..., then 14-26 are start and 2 and end at 1, 2, 3... and so on.)&lt;/P&gt;&lt;P&gt;You will need to setup enough parameters to hold the maximum number of available trips that can exist in the model. Those that are not needed for the particular decision should be set to 0. The action parameter is an integer that denotes which trip is started next. If an invalid trip is chosen (respective parameter is 0), request another decision and return a negative reward. Otherwise the reward could be given as the difference between the current total distance of routes driven by the truck and the expected distance after that many trips with the default order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was curious so I did a little experiment using&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Simulated_annealing" target="_blank" rel="noopener"&gt;Simulated Annealing&lt;/A&gt;&amp;nbsp;to optimize the order within the task table rows. In my test the total distance per truck was reduced to around 650km down from 730km. I've attached the model. It contains some scripts that might also be helpful for the RL approach (extracting trips from the route table).&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 15:16:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13873721#M98767</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2025-10-30T15:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13909077#M99032</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Thank you for your response; it has been very helpful to me. I have now applied your small experiment to perform optimization using the HOA method, which is a new approach, and it produced better results than the SA method. I have incorporated the HOA code into my program, but I encountered some errors. I have attached images and the file.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-11-18 125723.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1596892i01A766907DEB40FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-11-18 125723.png" alt="Screenshot 2025-11-18 125723.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If you are able to fix the stuck code, I would greatly appreciate it.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 05:58:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13909077#M99032</guid>
      <dc:creator>dulika_tookta</dc:creator>
      <dc:date>2025-11-18T05:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the best transportation route</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13909177#M99038</link>
      <description>&lt;P&gt;You need to convert your code to valid FlexScript. Commands and class methods are by default shown with a blue font. If some expression that should be a function is not highlighted that way, it's not a valid command. It's mostly getting/setting values from arrays and cloning them that is wrong in your code.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/25.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Array.html" target="_blank"&gt;https://docs.flexsim.com/en/25.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Array.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 07:38:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-find-the-best-transportation-route/m-p/13909177#M99038</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2025-11-18T07:38:04Z</dc:date>
    </item>
  </channel>
</rss>

