|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpamvotis.core.Simulator
public class Simulator
This is the basic class of Pamvotis that does all the work. It contains useful methods that the user can call in order to configure a simulation, run a simulation splitted in time intervals and collect results for each time interval or globally, for all the simulation.
Constructor Summary | |
---|---|
Simulator()
Creates a new simulation instance. |
Method Summary | |
---|---|
void |
addNode(int id,
int rate,
int coverage,
int xPosition,
int yPosition,
int ac)
Adds a new node to the system. |
boolean |
appendNewSource(int node,
Source newSource)
Appends a new source to a specific node |
void |
changeNodeParams(int node,
int coverage,
int xPosition,
int yPosition)
Changes the parameters of a node. |
void |
confParams()
Configures system and node parameters according to the "config/NtConf.xml" configuration file. |
float |
getDelay(int node)
Get the total delay of a node for the last simulation interval. |
float |
getJitter(int node)
Get the jitter of a node for the last simulation interval. |
float |
getMDelay(int node)
Get the media access delay of a node for the last simulation interval. |
MobileNode |
getNode(int nodeId)
Finds a node whose Id is 'nodeId', or null if the node with the specified ID does not exist. |
int |
getProgress()
|
float |
getQDelay(int node)
Get the queuing delay of a node for the last simulation interval. |
float |
getQLength(int node)
Get the average packet buffer length of a node for the last simulation interval. |
float |
getRatts(int node)
Get the average number of retransmission attempts of a node for the last simulation interval. |
float |
getSysThrBps()
Get the throughput of the system for the last simulation interval. |
float |
getSysThrPkts()
Get the throughput of the system for the last simulation interval. |
float |
getSysUtil()
Get the utilization of the system for the last simulation interval. |
float |
getThrBps(int node)
Get the throughput of a node for the last simulation interval. |
float |
getThrPkts(int node)
Get the throughput of a node for the last simulation interval. |
long |
getTime()
|
float |
getUtil(int node)
Get the utilization of a node for the last simulation interval. |
void |
printHeaders()
Prints the headers of the files which contain the statistic results Each statistic is printed only if the user asks it (depending on the containing characteristic two-character sets of the reslts string. |
void |
printMeanValues()
Prints the mean statistic results to text file. |
void |
removeAllNodes()
Removes all nodes from the system |
boolean |
removeAllSources(int node)
Removes all sources from the specified node. |
boolean |
removeNode(int nodeId)
Removes a node with a specific ID |
void |
removeSource(int node,
int sourceId)
Removes a source from a given node |
void |
simulate(long startTime,
long endTime)
Simulates a specific time interval. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Simulator()
SpecParams.ReadParameters()
Method Detail |
---|
public MobileNode getNode(int nodeId) throws ElementDoesNotExistException
nodeId
- The ID of the node.
ElementDoesNotExistException
public void simulate(long startTime, long endTime)
startTime
- The start time of the simulation interval in miliseconds.endTime
- The end time of the simulation interval in miliseconds.public void printHeaders()
public void printMeanValues()
public int getProgress()
public long getTime()
public float getThrBps(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the throughput
ElementDoesNotExistException
public float getSysThrBps()
public float getThrPkts(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the throughput
ElementDoesNotExistException
public float getSysThrPkts()
public float getUtil(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the utilization
ElementDoesNotExistException
public float getSysUtil()
public float getMDelay(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the media access delay
ElementDoesNotExistException
public float getQDelay(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the queuing delay
ElementDoesNotExistException
public float getDelay(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the total delay
ElementDoesNotExistException
public float getJitter(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the jitter.
ElementDoesNotExistException
public float getQLength(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the buffer length.
ElementDoesNotExistException
public float getRatts(int node) throws ElementDoesNotExistException
node
- The node for which we ask for the average number of retransmission attempts.
ElementDoesNotExistException
public void changeNodeParams(int node, int coverage, int xPosition, int yPosition)
node
- The node for which we want to change the parameters.coverage
- The node's coverage in meters.xPosition
- The node's x-axis coordinate in meters.yPosition
- The node's y-axis coordinate in meters.public void confParams()
public void addNode(int id, int rate, int coverage, int xPosition, int yPosition, int ac) throws ElementExistsException
id
- The ID of the new node.rate
- The data rate of the node.coverage
- The coverage of the node.xPosition
- The x-axis coordinate.yPosition
- The y-axis coordinateac
- The 802.11 EDCA access category.
ElementExistsException
public boolean removeNode(int nodeId) throws ElementDoesNotExistException
nodeId
- The ID of the node to be removed.
ElementDoesNotExistException
public void removeAllNodes()
public boolean appendNewSource(int node, Source newSource) throws ElementExistsException, ElementDoesNotExistException
node
- The node id, which is the element number of the vector that stores the nodes.newSource
- A source instance
ElementExistsException
ElementDoesNotExistException
Source
,
removeSource(int, int)
,
removeAllSources(int)
public boolean removeAllSources(int node) throws ElementDoesNotExistException
node
- The node id, which is the element number of the vector that stores the nodes.
ElementDoesNotExistException
removeSource(int, int)
,
appendNewSource(int, pamvotis.sources.Source)
,
MobileNode
public void removeSource(int node, int sourceId) throws ElementDoesNotExistException
node
- The node id from which the source will be removedsourceId
- The unique id of the session to be terminated
ElementDoesNotExistException
Source
,
appendNewSource(int, pamvotis.sources.Source)
,
removeAllSources(int)
,
MobileNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |