<?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: How to randomly pick a random seed to perform a flexsim simulation? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594344#M89516</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P id="isPasted"&gt;Okay, I'll try and see, but it'll take a while.&lt;/P&gt;
 &lt;P&gt;My previous attempts to use an external 3rd party (python) have been unsuccessful.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1702323597067.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1521437iAD60B92E793B163C/image-size/large?v=v2&amp;amp;px=999" role="button" title="1702323597067.png" alt="1702323597067.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P id="isPasted"&gt;But I will solve the "FlexSimPy" problem again first, and then solve the current problem according to your suggestions.&lt;/P&gt;
 &lt;P&gt;Thank you for your valuable advice!&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 11 Dec 2023 19:49:23 GMT</pubDate>
    <dc:creator>Xuan_123</dc:creator>
    <dc:date>2023-12-11T19:49:23Z</dc:date>
    <item>
      <title>How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594337#M89509</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.0.10 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;I use python to open flexsim and simulate it once. I will open multiple flexsims, and each flexsim will only reset run once. But because the random seeds are fixed at the first one, my multiple flexsim simulation results are the same.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I hope that when the model is opened, a random seed is randomly selected to execute the simulation of the model, instead of only running the random seed of the first simulation every time it is opened.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;How can I write flexscript to achieve this?&lt;/P&gt;
 &lt;P&gt;My current idea is to use On Model Open Trigger to execute a randomly generated random seed environment, but I don't know how to write the program.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I have referred to this article.&lt;/P&gt;
 &lt;P&gt;&lt;A rel="nofollow" id="isPasted" href="https://answers.flexsim.com/questions/92158/how-to-set-seed-of-random-functions.html"&gt;https://answers.flexsim.com/questions/92158/how-to-set-seed-of-random-functions.html&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Thank you for your reply!&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:09:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594337#M89509</guid>
      <dc:creator>Xuan_123</dc:creator>
      <dc:date>2023-12-11T17:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594338#M89510</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;If you go into the Statistics Settings, you can uncheck "Repeat Random Streams".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1702317379188.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1521432i133A986CC08C289B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1702317379188.png" alt="1702317379188.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then, when you reset the model, the random stream seed will change. Random events will be different each time you reset and run the model.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:56:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594338#M89510</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-12-11T17:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594339#M89511</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;I tried this and it doesn't work&lt;/P&gt;
 &lt;P&gt;This method is effective for multiple resets and runs within a model.&lt;/P&gt;
 &lt;P&gt;But my problem is that I open a new flexsim window every time and only execute it once.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1702318596349.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1521440iB64F97FD681E0047/image-size/large?v=v2&amp;amp;px=999" role="button" title="1702318596349.png" alt="1702318596349.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 18:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594339#M89511</guid>
      <dc:creator>Xuan_123</dc:creator>
      <dc:date>2023-12-11T18:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594340#M89512</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;It would be better that you set the replication number by which all seeds will be set.  This way you can repeat your trials by just choosing the replication number in the experimenter gui and setting parameters to match.&lt;/P&gt;&lt;P&gt;Set this node value before a reset:&lt;/P&gt;&lt;PRE&gt;MODEL:/Tools/randomrepeatrep&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 18:45:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594340#M89512</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-12-11T18:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594341#M89513</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42719/xuan-123.html" nodeid="42719"&gt;@Xuan_123&lt;/A&gt;, you can try receiving a random number from python using User Commands (reference &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/questions/123230/how-to-use-flexscript-python-to-create-the-data-in.html" target="_blank"&gt;this post&lt;/A&gt; on setting up a Python User Command). You can then setup an "OnModelOpen" trigger to run get 2 random numbers from python. If your command was called "MyRandomNumber()", your trigger code may look like this:&lt;/P&gt;&lt;PRE&gt;int stream = MyRandomNumber();
int seed = MyRandomNumber();
randinit(stream, seed);&lt;/PRE&gt;&lt;P&gt;With your python code looking like this:&lt;/P&gt;&lt;PRE&gt;import random

def random_number():
    return random.randint(0, 2000)&lt;/PRE&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/76978-random-number.py" target="_blank"&gt;random_number.py&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/76979-random-example.fsm" target="_blank"&gt;random_example.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 18:59:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594341#M89513</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-12-11T18:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594342#M89514</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;I previously tried to write On Model Open like this to test the model, but the entry parcel for the first simulation under different windows was still 3.&lt;/P&gt;
 &lt;P&gt;I think this is the same approach as you suggested. I don’t know if I misunderstood.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1702321904126.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1521435i8143468ACF8CDDDC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1702321904126.png" alt="1702321904126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 19:12:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594342#M89514</guid>
      <dc:creator>Xuan_123</dc:creator>
      <dc:date>2023-12-11T19:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594343#M89515</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42719/xuan-123.html" nodeid="42719"&gt;@Xuan_123&lt;/A&gt;, the way you initially attempted was using the built-in duniform which is &lt;EM&gt;still using the stream and seed originally set by FlexSim&lt;/EM&gt;. The approach I suggest uses an external 3rd-party (python) to pick random numbers between 0 and 2000 to give you for your stream and seed. Since you're getting the values from an external program, they will not be associated with the model's current random stream and reset it. Please open and try the files I attached.&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 19:15:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594343#M89515</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-12-11T19:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594344#M89516</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P id="isPasted"&gt;Okay, I'll try and see, but it'll take a while.&lt;/P&gt;
 &lt;P&gt;My previous attempts to use an external 3rd party (python) have been unsuccessful.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1702323597067.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1521437iAD60B92E793B163C/image-size/large?v=v2&amp;amp;px=999" role="button" title="1702323597067.png" alt="1702323597067.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P id="isPasted"&gt;But I will solve the "FlexSimPy" problem again first, and then solve the current problem according to your suggestions.&lt;/P&gt;
 &lt;P&gt;Thank you for your valuable advice!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 19:49:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594344#M89516</guid>
      <dc:creator>Xuan_123</dc:creator>
      <dc:date>2023-12-11T19:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594345#M89517</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42719/xuan-123.html" nodeid="42719"&gt;@Xuan_123&lt;/A&gt;, you can follow &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/questions/123230/how-to-use-flexscript-python-to-create-the-data-in.html" target="_blank"&gt;this post&lt;/A&gt; I made a while back on setting up Python scripts with User Commands. That may help resolve some issues. Also, make sure the names are spelled correctly - they are case sensitive.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 20:29:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594345#M89517</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-12-11T20:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594346#M89518</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;Excuse me&lt;/P&gt;
 &lt;P&gt;I would like to ask you, is it possible to use pycharm to compile python? Or do I need to use VScode to achieve it?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:35:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594346#M89518</guid>
      <dc:creator>Xuan_123</dc:creator>
      <dc:date>2023-12-13T17:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594347#M89519</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1702489526576.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1521441iF40561DE8211E175/image-size/large?v=v2&amp;amp;px=999" role="button" title="1702489526576.png" alt="1702489526576.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P id="isPasted"&gt;Excuse me.&lt;/P&gt;
 &lt;P&gt;I would like to confirm again. If I use socket to connect python and flexsim, can it also be regarded as an external third party (python)?&lt;/P&gt;
 &lt;P&gt;But the entry parcels I currently simulate are still 3.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Dec 2023 17:50:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594347#M89519</guid>
      <dc:creator>Xuan_123</dc:creator>
      <dc:date>2023-12-13T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594348#M89520</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42719/xuan-123.html" nodeid="42719"&gt;@Xuan_123&lt;/A&gt;, yes you can use PyCharm. However, you need to make sure that your environments (PyCharm and command prompt) both see the same libraries and python paths.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Yes, you can also use python and socket connections with FlexSim. You can try looking at this post: &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/comments/130619/view.html" target="_blank"&gt;https://answers.flexsim.com/comments/130619/view.html&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Dec 2023 18:10:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594348#M89520</guid>
      <dc:creator>kavika_faleumu</dc:creator>
      <dc:date>2023-12-13T18:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly pick a random seed to perform a flexsim simulation?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594349#M89521</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42719/xuan-123.html" nodeid="42719"&gt;@xuan-123&lt;/A&gt;, was Kavika F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. 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, 20 Dec 2023 15:52:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-randomly-pick-a-random-seed-to-perform-a-flexsim/m-p/13594349#M89521</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-12-20T15:52:26Z</dc:date>
    </item>
  </channel>
</rss>

