gymwipe.networking.devices module¶
Device implementations for network devices
-
class
NetworkDevice(name, xPos, yPos, frequencyBand)[source]¶ Bases:
gymwipe.devices.core.DeviceA subclass of
Devicethat extends the constructor’s parameter list by a frequencyBand argument. The providedFrequencyBandobject will be stored in thefrequencyBandattribute.Parameters: - name (
str) – The device name - xPos (
float) – The device’s physical x position - yPos (
float) – The device’s physical y position - band (frequency) – The
FrequencyBandinstance that will be used for transmissions
-
frequencyBand= None[source]¶ The
FrequencyBandinstance that is used for transmissionsType: FrequencyBand
- name (
-
class
SimpleNetworkDevice(name, xPos, yPos, frequencyBand)[source]¶ Bases:
gymwipe.networking.devices.NetworkDeviceA
NetworkDeviceimplementation running a network stack that consists of a SimplePHY and a SimpleMAC. It offers a method for sending a packet using the MAC layer, as well as a callback method that will be invoked when a packet is received. Also, receiving can be turned on or of by settingreceivingeither toTrueor toFalse.Parameters: - name (
str) – The device name - xPos (
float) – The device’s physical x position - yPos (
float) – The device’s physical y position - band (frequency) – The
FrequencyBandinstance that will be used for transmissions
-
macAddr= None[source]¶ The address that is used by the MAC layer to identify this device
Type: bytes
- name (
-
class
SimpleRrmDevice(name, xPos, yPos, frequencyBand, deviceIndexToMacDict, interpreter)[source]¶ Bases:
gymwipe.networking.devices.NetworkDeviceA Radio Resource Management
NetworkDeviceimplementation. It runs a network stack consisting of a SimplePHY and a SimpleRrmMAC. It offers a method for frequency band assignment and operates anInterpreterinstance that provides observations and rewards for a learning agent.Parameters: - name (
str) – The device name - xPos (
float) – The device’s physical x position - yPos (
float) – The device’s physical y position - band (frequency) – The
FrequencyBandinstance that will be used for transmissions - deviceIndexToMacDict (
Dict[int,bytes]) – A dictionary mapping integer indexes to device MAC addresses. This allows to pass the device index used by a learning agent instead of a MAC address toassignFrequencyBand(). - interpreter (
Interpreter) – TheInterpreterinstance to be used for observation and reward calculations
-
interpreter= None[source]¶ The
Interpreterinstance that provides domain-specific feedback on the consequences ofassignFrequencyBand()callsType: Interpreter
-
deviceIndexToMacDict= None[source]¶ A dictionary mapping integer indexes to device MAC addresses. This allows to pass the device index used by a learning agent instead of a MAC address to
assignFrequencyBand().
-
macToDeviceIndexDict= None[source]¶ The counterpart to
deviceIndexToMacDict
-
assignFrequencyBand(deviceIndex, duration)[source]¶ Makes the RRM assign the frequency band to a certain device for a certain time.
Parameters: - deviceIndex (
bytes) – The integer id that maps to the MAC address of the device to assign the frequency band to (seedeviceIndexToMacDict) - duration (
int) – The number of time units for the frequency band to be assigned to the device
Return type: Returns: The
Signalobject that was used to make the RRM MAC layer assign the frequency band. When the frequency band assignment is over, the signal’seProcessedevent will succeed.- deviceIndex (
- name (