我的模型环境是一台SMT表面贴装机,里面包含CAP和CPSP问题,有5个动作对应5个启发式规则,这与flexsim官网提供的示例不同,我的问题观察空间是多维向量,错误发生在连接 env.py。123456789_29_autosave_2_autosave.fsm
我的模型环境是一台SMT表面贴装机,里面包含CAP和CPSP问题,有5个动作对应5个启发式规则,这与flexsim官网提供的示例不同,我的问题观察空间是多维向量,错误发生在连接 env.py。123456789_29_autosave_2_autosave.fsm
Hello,
Jordan explains how to change the observation space in the following question custom observation space for RL - FlexSim Community. However, the Python file will need to be modified to accept and work with this data.
Another alternative could be to pass a table to a set of parameters using code like the following:
treenode toCopy = Model.find("Tools/ParameterTables/flujosCosteMinimo>variables/parameters/1"); Table costes = Table("MatrizCostes"); int num = 0; for (int i = 1; i <= costes.numRows; i++){ for (int j = 1; j <= costes.numCols; j++){ num += 1; /* //Run ths code the firts time you create the parameters. then coment it and reRun the code. if(!(i == 1 && j == 1)){ nodeinsertafter(toCopy); createcopy(toCopy,toCopy.next,0,0,0,1); }*/ treenode Copied = Model.find("Tools/ParameterTables/flujosCosteMinimo>variables/parameters/"+num); Model.find(Copied.getPath()+"/Name").value = "flujosCosteMinimo[" + i + "][" + j + "]"; Model.find(Copied.getPath()+"/Value").value = 4; Model.find(Copied.getPath()+"/Value/type").value = 2; Model.find(Copied.getPath()+"/Value/lowerBound").value = 0; Model.find(Copied.getPath()+"/Value/upperBound").value = 10000; } }
Then, in each onObservation, the value should be modified using code like this:
Table costes = Table("MatrizCostes") for (int i = 1; i <= costes.numRows; i++){ for (int j = 1; j <= costes.numCols; j++){ Model.parameters["flujosCosteMinimo[" + i + "][" + j + "]"].value = costes[i][j];
Thank you very much, and I hope it helps
Thanks, if method 2 is used, does the Python code need to be modified?
No, in this second method, you will need to define the Observation Space as MultiDiscrete:
This should work. However, keep in mind that the number of possible Observation Spaces grows exponentially with the number of parameters. Extremely large observation spaces can make reinforcement learning (RL) training difficult and affect the quality of results.
I originally conceived it according to the code logic in Figure 1, because I currently have 6 states to collect, and the size of each state is also different, for example, state 1 is a 3*3 spatial coordinate, state 2 is a 30*3 spatial coordinate, and so on. The MultiDiscrete type doesn't meet my needs, because my states are of matrix type, and I'm using the Array type instead.
Thank you very much for your reply
15 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