Simpy Resource : Get ID?
<p>I have two airport runways as a Simpy Resource:</p>

<pre><code>runway = simpy.Resource(env, capacity=2) # two runways
</code></pre>

<p>This works all fine, but how can I access the runway id (1 or 2) so that I can have an output such as 'Plane #1 taking off from runway #1'?</p>

<p>You canât (officially).  Internally, the slots are just a list so you could in theory use the list index of the Request.</p>

<p>Alternatively, you might use <code>Store</code> and put two "Runway" objects into it.  These objects have (of course) an ID an can also carry additional information (whatever you can imagine).</p>

python simpy