nl.tudelft.simulation.messaging.devices.components
Class Device

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.messaging.devices.components.Device
All Implemented Interfaces:
DeviceInterface, nl.tudelft.simulation.event.EventProducerInterface, java.io.Serializable
Direct Known Subclasses:
ReceivingDevice, SendingDevice, SendingReceivingDevice

public abstract class Device
extends nl.tudelft.simulation.event.EventProducer
implements DeviceInterface

An abstract Device that can be extended to a sending device, a receiving device, or a device that combines sending and receiving.

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Version:
$$Revision: 1.3 $$ $$Date: 2005/04/08 11:29:12 $$
Author:
Peter Jacobs , Stijn-Pieter van Houten , Alexander Verbraeck
See Also:
Serialized Form

Field Summary
protected  java.lang.String name
          Name of the device
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.messaging.devices.components.DeviceInterface
STATE_CHANGE_EVENT
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
Device(java.lang.String name, DeviceType deviceType)
          constructs a new device, take the transmission delay and frequency from the DeviceType.
Device(java.lang.String name, DeviceType deviceType, int transmissionDelay, double transmissionFrequency)
          constructs a new device, override the default transmission delay and frequency from the DeviceType.
 
Method Summary
 DeviceType getDeviceType()
          returns the device type
 java.lang.String getName()
          returns the name of the device
 DeviceState getState()
          returns the state of the device
 int getTransmissionDelay()
          The transmission delay is defined on a log-10 scale, indicating the time it takes averagely in seconds to reach the other Actor.
 double getTransmissionFrequency()
          The maximum transmission frequency indicates the average number of messages (say 1 page with data) that can be sent per second over the communication channel.
 void setState(DeviceState state)
           
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypes, removeListener
 

Field Detail

name

protected java.lang.String name
Name of the device

Constructor Detail

Device

public Device(java.lang.String name,
              DeviceType deviceType)
constructs a new device, take the transmission delay and frequency from the DeviceType.

Parameters:
name - the name or description of the device
deviceType - the type of device

Device

public Device(java.lang.String name,
              DeviceType deviceType,
              int transmissionDelay,
              double transmissionFrequency)
constructs a new device, override the default transmission delay and frequency from the DeviceType.

Parameters:
name - the name or description of the device
deviceType - the type of device
transmissionDelay - the default logarithmic transmission delay of the device.
transmissionFrequency - the maximum transmission frequency of the device.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: DeviceInterface
returns the name of the device

Specified by:
getName in interface DeviceInterface
Returns:
the name
See Also:
DeviceInterface.getName()

getState

public DeviceState getState()
Description copied from interface: DeviceInterface
returns the state of the device

Specified by:
getState in interface DeviceInterface
Returns:
the state
See Also:
DeviceInterface.getState()

setState

public void setState(DeviceState state)
Parameters:
state - The state to set.

getDeviceType

public DeviceType getDeviceType()
Description copied from interface: DeviceInterface
returns the device type

Specified by:
getDeviceType in interface DeviceInterface
Returns:
Returns the deviceType.
See Also:
DeviceInterface.getDeviceType()

getTransmissionDelay

public int getTransmissionDelay()
Description copied from interface: DeviceInterface
The transmission delay is defined on a log-10 scale, indicating the time it takes averagely in seconds to reach the other Actor.

Specified by:
getTransmissionDelay in interface DeviceInterface
Returns:
the transmission delay of the device
See Also:
DeviceInterface.getTransmissionDelay()

getTransmissionFrequency

public double getTransmissionFrequency()
Description copied from interface: DeviceInterface
The maximum transmission frequency indicates the average number of messages (say 1 page with data) that can be sent per second over the communication channel.

Specified by:
getTransmissionFrequency in interface DeviceInterface
Returns:
the maximum transmission frequency of the device
See Also:
DeviceInterface.getTransmissionFrequency()


Copyright © 2004-2005 Delft University of Technology, the Netherlands. All Rights Reserved.