Use SimPy to simulate job shop problem
Lately, I found this great discrete-event simulation framework SimPy. It utilises the generator functionality in Python to create simulation. I feel this is a very nice and clean tool with only a bunch of open source python files. I happen to have the need to create a simulation tool to model job shop where each job goes through a sequence of operations. Each operation can only be performed by a certain type of machine. Each type has a certain capacity. So if the job is requesting a machine but all of them are busy, the job must wait for the next free machine. The framework also supports priority request, meaning not always the first request will get the next free resource, but the most important request will get the resource. One little extension I made is to allow break times for each resource. This is useful if the machine is a person or something is on and off. Break times are introduced as a high priority event for that resource. So when the resource finishes a job around the break time, it will start take the break. Preemption is also easy to implement. Overall, I think this is very cool~ The link is below