edu.colorado.cs.ns2.agents
Class ExponentialAgent

java.lang.Object
  extended by edu.colorado.cs.ns2.agents.Application
      extended by edu.colorado.cs.ns2.agents.ExponentialAgent
All Implemented Interfaces:
java.io.Serializable

public class ExponentialAgent
extends Application

Class for representing UDP packet generation in the form of an exponential distribution of packet arrivals.

Author:
Kevin Bauer, Pushkar Sambhoos.
See Also:
Serialized Form

Nested Class Summary
 class ExponentialAgent.ExponentialPropertiesDialog
          Displays a dialog box allowing the user to specify this Application's properties.
 
Field Summary
private  double burstTime_
          NS2 Exponential traffic generator burst time field.
private  double idleTime_
          NS2 Exponential traffic generator idle time field.
private  double rate_
          NS2 Exponential traffic generator rate field.
private static long serialVersionUID
          Generated seraial version UID
private  java.lang.String type_
          NS2 Exponential traffic generator type field.
 
Fields inherited from class edu.colorado.cs.ns2.agents.Application
acceptableConnectAgents, agentId, applicationId, applicationName, nodeId, startEventScheduled, stopEventScheduled, variableName
 
Constructor Summary
ExponentialAgent(int nextId, int nodeId, int agentId)
          Default Constructor
 
Method Summary
 java.lang.String addApplicationToScript(NsNode node, int agentElement)
          Returns the String to be Written for the CBR Application
 double getBurstTime_()
          Returns the TCL burst time field.
 double getIdleTime_()
          Returns the TCL idle time value.
 double getRate_()
          Returns the TCL rate field.
 java.lang.String getType_()
          Returns the TCL type value.
protected  void setAcceptableConnectAgents()
          Sets the Vector of acceptable Agents on which this Application type may be attached.
 void setBurstTime_(double burstTime_)
          Sets the TCL burst time field.
 void setIdleTime_(double idleTime_)
          Sets the TCL idle time value.
 void setProperties()
          Sets the properties for this Application type.
 void setRate_(double rate_)
          Sets the TCL rate field.
 void setType_(java.lang.String type_)
          Sets the TCL type value.
 java.lang.String toString()
          Returns a String representation of an ExponentialAgent object.
 
Methods inherited from class edu.colorado.cs.ns2.agents.Application
getAcceptableAgents, getAgentId, getApplicatinName, getApplicationId, getApplicationName, getNodeId, getVariableName, isStartEventScheduled, isStopEventScheduled, setAgentId, setApplicatioName, setApplicationId, setApplicationName, setNodeId, setStartEventScheduled, setStopEventScheduled, setVariableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated seraial version UID

See Also:
Constant Field Values

type_

private java.lang.String type_
NS2 Exponential traffic generator type field.


rate_

private double rate_
NS2 Exponential traffic generator rate field.


burstTime_

private double burstTime_
NS2 Exponential traffic generator burst time field.


idleTime_

private double idleTime_
NS2 Exponential traffic generator idle time field.

Constructor Detail

ExponentialAgent

public ExponentialAgent(int nextId,
                        int nodeId,
                        int agentId)
Default Constructor

Parameters:
nextId - - Agent/ Application id - Globally Incremented.
nodeId - - Associates with this Node.
Method Detail

getBurstTime_

public double getBurstTime_()
Returns the TCL burst time field.

Returns:
The TCL burst time field.

setBurstTime_

public void setBurstTime_(double burstTime_)
Sets the TCL burst time field.

Parameters:
burstTime_ - A new burst time value.

getIdleTime_

public double getIdleTime_()
Returns the TCL idle time value.

Returns:
The TCL idle time value.

setIdleTime_

public void setIdleTime_(double idleTime_)
Sets the TCL idle time value.

Parameters:
idleTime_ - A new idle time value.

setAcceptableConnectAgents

protected void setAcceptableConnectAgents()
Sets the Vector of acceptable Agents on which this Application type may be attached.

Specified by:
setAcceptableConnectAgents in class Application

addApplicationToScript

public java.lang.String addApplicationToScript(NsNode node,
                                               int agentElement)
Returns the String to be Written for the CBR Application

Specified by:
addApplicationToScript in class Application
Parameters:
node - The Node to Attach Application To
agentElement - Index of Agent to which Application is to be attached.
Returns:
String to be written to Script.

getRate_

public double getRate_()
Returns the TCL rate field.

Returns:
The TCL rate field.

setRate_

public void setRate_(double rate_)
Sets the TCL rate field.

Parameters:
rate_ - A new rate value.

getType_

public java.lang.String getType_()
Returns the TCL type value.

Returns:
The TCL type value.

setType_

public void setType_(java.lang.String type_)
Sets the TCL type value.

Parameters:
type_ - A new type value.

toString

public java.lang.String toString()
Returns a String representation of an ExponentialAgent object.

Overrides:
toString in class java.lang.Object

setProperties

public void setProperties()
Sets the properties for this Application type.

Specified by:
setProperties in class Application