Hi all,
I am working on a project which uses SimPy for simulation. We have a set of objects grouped in different groups (coded in python via a sorted dictionary). Each group has a specific capacity which can hold objects. The current implementation uses a dictionary like this:
def get_group_info():{
return SortedDict(
{
1: {
"usable_cap": 70.2,
"remain_cap": 15.0,
"shape": "2",
"loc:": "CA-north-1",
"fraction": 0,
"spindles": 600 * 2,
},....
}
}
In a set of different operations objects get put into a container (which reduces "remain_cap") or gets deleted from a container (which adds to "remain_cap").
Now I have 2 questions:
1- Why should I use SimPy containers over the current implementation via a dictionary?
2- Assume objects have an expiration time, meaning that once an objects put into a container it has a timestamp associated with it to show the put time (in days), once 30 days (expiration period) passes the put time that object has to be removed from the container. Is there a way I can model this scenario in SimPy?
I couldn't join the group as I kept getting an error ("An error happened while joining, try again!")!
I appreciate your help in advance!
Best,
Shah