Module supervisor :: Class Runtime
[hide private]
[frames] | no frames]

type Runtime

source code

object --+
         |
        Runtime

Object called by a device to get its neighbours at each timepoint. Each device will get a different instance of this type which wraps the Supervisor object.

Instance Methods [hide private]
 
__init__(self, supervisor, device_id)
!!! This is not part of the assignment API, do not call it !!!
source code
List of Device
get_neighbours(self)
Returns the list of neighbours for the current timepoint and increments the timepoint for the next invocation.
source code
Method Details [hide private]

__init__(self, supervisor, device_id)
(Constructor)

source code 

!!! This is not part of the assignment API, do not call it !!!

Creates a new Runtime object.

Parameters:
  • supervisor (Supervisor) - the supervisor object to wrap
  • device_id (Integer) - the id of the device which uses this Runtime instance
Overrides: object.__init__

get_neighbours(self)

source code 

Returns the list of neighbours for the current timepoint and increments the timepoint for the next invocation. WARNING: this method is not thread-safe, do not call it concurrently

Returns: List of Device
the list of current neighbours