This is a simple layout simulator capable of simulating any number of stations and robots to find out the movement of payloads through your layout and final output of the layout.
Github source code - iamJohnnySam/Throughput_Calculator (github.com)
To configure your stations we need to edit the stations.json file which has the below json format to edit.
{
'Loading': {
'Time': 0,
'Robot': false,
'Capacity': 100000,
'Stations': 1,
'Buffer': false,
'Attached': ''
},
'Station 1': {
'Time': 5,
'Robot': false,
'Capacity': 1,
'Stations': 1,
'Buffer': false,
'Attached': ''
}
}
The Key on the outside refers to the name of the station. The keys on the inner dictionary refer to the following.
- Time - Float: Process time in minutes for this station. Process time will start when the capacity of the station is full
- Robot - Boolean: Whether the robot needs to be involved in the process. For the duration of the process the robot will be blocked for this process and the payload will be transferred back to the robot immediately after the process completes.
- Capacity - Int: How many payloads needed to fill the station.
- Stations - Int: How many stations are available in the layout
- Buffer - Bool: Is the station acting as a buffer station. If buffer, Time should be set to 1 and the robot will always avoid this station if the next station is available.
- Attached - String: Name of the station to which this is attached. If there are payloads in this station then the attached station will be blocked from being used.
Update 2024.02.17
Having needed some additional functionalities I updated my code with the following features.
- Little better UI
- Able to hide unnecessary details
- Able to save mutiple layouts in seperate json scripts and select which json script to run.
- Robot will now block the station it is about to use to prevent another payload claiming that station. This can be seen in blue.
- Stations and Robots now have an 'area' which means that robots can be dedicated for certain stations.
- If more than 1 area is used, transfer stations will be automatically generated to transfer between areas.
- The same station can be created in 2 areas by duplicating the station in the json script and changing the area.
- A process variable is added to the station. The sequence will be automatically generated using the process variable.
- As before buffer stations will be avoided if the station after it is empty
- Buffer station name will be automatically generated using the name of the previous station.
- If 2 stations existst with the same process in 2 areas the robot will optimize the motion so that it will place the payload in the station in the same area before it decides to place it in a station where the area is not the same.
- If the simulation deadlocks where all payloads are in waiting condition, the simulation will end and an error message will show. However, I have optimized the program such that simulation itself will prevent deadlock from occuring
New json script structure:
{
'Wet Robot': {
'type': 'robot',
'area': 'wet',
'count': 1,
'get_time': 15,
'put_time': 15
},
'Dry Robot': {
'type': 'robot',
'area': 'dry',
'count': 1,
'get_time': 15,
'put_time': 15
},
'Loading': {
'type': 'station',
'process': 'loading',
'area': 'wet',
'time': 0,
'capacity': 100000,
'count': 1,
'buffer': false,
'attach': ''
},
'Station 1': {
'type': 'station',
'process': 'process1',
'area': 'wet',
'time': 5,
'capacity': 2,
'count': 1,
'buffer': false,
'attach': ''
},
'Sta 1 Ext': {
'type': 'station',
'process': 'process2',
'area': 'wet',
'time': 5,
'capacity': 2,
'count': 1,
'buffer': false,
'attach': 'Station 1'
},
'Station 2': {
'type': 'station',
'process': 'process3',
'area': 'dry',
'time': 55,
'capacity': 2,
'count': 2,
'buffer': false,
'attach': ''
},