DRCL J-Sim API

drcl.inet.mac
Class Channel

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.net.Module
              extended bydrcl.inet.mac.Channel
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable

public class Channel
extends Module

This class simulates a shared wireless channel. A Channel component contains a vector of Ports as well as an array of boolean flags. If a mobile node's wireless interface card is working on a given channel, the downPort of the WirelessPhy component is connected to the corresponding port of the Channel component and the flag is set correspondingly. The Channel component also contains a trackerPort which should be connected to the channelPort of a NodePositionTracker component. When a data packet is sent from a wireless interface card to the Channel component, the Channel component consults the NodePositionTracker to decide to which others nodes that data packet should be sent. How the neighbouring nodes are decided can be find in NodePositionTracker. Whether that data packet should be really received(decoded) by the receivers shall be further determined at each WirelessPhy component respectively. In this way, a shared medium is simulated without unnecessarily passing each data packet to all nodes listenning to that channel.

Author:
Ye Ge
See Also:
NodePositionTracker, NodeChannelContract, WirelessPhy, Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
 int nGrids
          A variable indicating what is the maximum distance if an subarea is considered as the neightbouring grid to the current position of the sender node.
 
Fields inherited from class drcl.net.Module
downPort, PortGroup_DOWN, PortGroup_UP, upPort
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
Channel()
          Constructor.
 
Method Summary
 void attachPort(int nid, Port port_)
          Attaches the nid-th element in the port vector to the Port port_.
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
 java.lang.String getName()
          Returns the (informational) name of the component.
 void setCapacity(int n)
          Sets the capacity (the maximal number of wireless interface cards to communicate on this channel).
 void setnGrids(int n)
          Set nGrids variable.
 
Methods inherited from class drcl.net.Module
cancelTimeout, setTimeout, setTimeoutAt
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getParent, getPort, getPort, getRoot, getTime, iduplicate, info, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, reset, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nGrids

public int nGrids
A variable indicating what is the maximum distance if an subarea is considered as the neightbouring grid to the current position of the sender node.

Constructor Detail

Channel

public Channel()
Constructor.

Method Detail

setnGrids

public void setnGrids(int n)
Set nGrids variable. All nodes within n-grid subarea are considered neighbors

Parameters:
n - - grid size

setCapacity

public void setCapacity(int n)
Sets the capacity (the maximal number of wireless interface cards to communicate on this channel). We need this information from the user to decide the size of the vp_flag array.


attachPort

public void attachPort(int nid,
                       Port port_)
Attaches the nid-th element in the port vector to the Port port_.

Parameters:
nid - the node id of the node whose wireless interface card (WirelessPhy) is working on this channel.
port_ - the downport of the WirelessPhy component which is working on this channel.

getName

public java.lang.String getName()
Description copied from class: Component
Returns the (informational) name of the component.

Overrides:
getName in class Component

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: Component
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. Subclasses need to override this method to copy its own variables.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Module

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~