Hello, as you can see in this video, when I call Python, some functions do not return values properly. Would you please help me see what the problem is, and I would appreciate it.
Relevant attachments have been uploaded(PythonFunction)
Hello, as you can see in this video, when I call Python, some functions do not return values properly. Would you please help me see what the problem is, and I would appreciate it.
Relevant attachments have been uploaded(PythonFunction)
I'm trying to write an Astar algorithm myself, but I found that the model was slow when there was a lot of kiva and the map was large. So I want to see if calling Python scripts could evaluate paths faster and thus speed up the model. Could you give me some suggestions? Thanks again!
Hey @shaon S, I think I found the problem. When using "range" in a for loop, the value passed in must be an int. num1 is a double, and so when trying to calculate range, it was working incorrectly. I tried casting num1 to an int in the range function and my FlexSim function works fine now.
(I was messing around with some values for testing, so I'm appending a random value and then the value num1 that many times. It should work fine with our code)
Thank you for your help. I have another question.When Flexsim needs to call Python frequently, can Python enable multithreading for processing and return values?Thanks again.
On another note, I don't think that a custom Python AStar algorithm that FlexSim calls repeatedly will be any faster on a large model with many Kivas, especially since the original AStar algorithm is built in C++. I suggest finding other ways to minimize resource allocation in the model. For example, if you have racks with many flowitems, you can turn on virtualization.
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved