Package ons
Class OXC
java.lang.Object
ons.OXC
public abstract class OXC
extends java.lang.Object
The Optical Cross-Connects (OXCs) can switch the optical signal coming
in on a wavelenght of an input fiber link to the same wavelength in an
output fiber link. The OXC may also switch the optical signal on an
incoming wavelength of an input fiber link to some other wavelength on
an output fiber link.
The OXC object has grooming input and output ports.
Traffic grooming is the process of grouping many small data flows
into larger units, so they can be processed as single units.
Grooming in OXCs has the objective of minimizing the cost of the network.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.TreeSet<java.lang.Integer>
freeGroomingInputPorts
protected java.util.TreeSet<java.lang.Integer>
freeGroomingOutputPorts
protected int
groomingInputPorts
protected int
groomingOutputPorts
protected int
id
protected int
nodeDegree
-
Constructor Summary
Constructors Constructor Description OXC(int id, int groomingInputPorts, int groomingOutputPorts, int type, int group)
Creates a new OXC object.All its attributes must be given given by parameter, except for the free grooming input and output ports, that, at the beginning of the simulation, are the same as the total number of grooming input and output ports. -
Method Summary
Modifier and Type Method Description boolean
allFreeGroomingInputPort()
Says whether or not a given OXC has all free grooming input port(s).boolean
allFreeGroomingOutputPort()
Says whether or not a given OXC has all free grooming output port(s).int[]
getActiveGroomingInputPorts()
int[]
getActiveGroomingOutputPorts()
int[]
getFreeGroomingInputPorts()
int[]
getFreeGroomingOutputPorts()
int
getGroomingInputPorts()
int
getGroomingOutputPorts()
int
getGroup()
Retrieves the OXC's Group.int
getID()
Retrieves the OXC's unique identifier.int
getNodeDegree()
Retrieves the node degree (number of neighbors)int
getType()
Retrieves the OXC's Type.boolean
hasFreeGroomingInputPort()
Says whether or not a given OXC has free grooming input port(s).boolean
hasFreeGroomingInputPort(int groomingInputPort)
Says whether or not a given groomingInputPort in this OXC has freeboolean
hasFreeGroomingOutputPort()
Says whether or not a given OXC has free grooming output port(s).boolean
hasFreeGroomingOutputPort(int groomingOutputPort)
Says whether or not a given groomingOutputPort in this OXC has freeboolean
isSleep()
Retrieves whether the OXC is sleeping or awakeboolean
releaseGroomingInputPort(int groomingInputPort)
By increasing the number of free grooming input ports, this function "releases" a grooming input port.boolean
releaseGroomingOutputPort(int groomingOutputPort)
By increasing the number of free grooming output ports, this function "releases" a grooming output port.int
reserveGroomingInputPort()
By decreasing the number of free grooming input ports, this function "reserves" a grooming input port.int
reserveGroomingOutputPort()
By decreasing the number of free grooming output ports, this function "reserves" a grooming output port.protected void
setNodeDegree(int nodeDegree)
-
Field Details
-
id
protected int id -
groomingInputPorts
protected int groomingInputPorts -
groomingOutputPorts
protected int groomingOutputPorts -
freeGroomingInputPorts
protected java.util.TreeSet<java.lang.Integer> freeGroomingInputPorts -
freeGroomingOutputPorts
protected java.util.TreeSet<java.lang.Integer> freeGroomingOutputPorts -
nodeDegree
protected int nodeDegree
-
-
Constructor Details
-
OXC
public OXC(int id, int groomingInputPorts, int groomingOutputPorts, int type, int group)Creates a new OXC object.All its attributes must be given given by parameter, except for the free grooming input and output ports, that, at the beginning of the simulation, are the same as the total number of grooming input and output ports.- Parameters:
id
- the OXC's unique identifiergroomingInputPorts
- total number of grooming input portsgroomingOutputPorts
- total number of grooming output portstype
- OXC type, used in TrafficGeneratorgroup
- OXC group, used in TrafficGenerator
-
-
Method Details
-
getID
public int getID()Retrieves the OXC's unique identifier.- Returns:
- the OXC's id attribute
-
getNodeDegree
public int getNodeDegree()Retrieves the node degree (number of neighbors)- Returns:
- the number of neighbors in this node
-
setNodeDegree
protected void setNodeDegree(int nodeDegree) -
hasFreeGroomingInputPort
public boolean hasFreeGroomingInputPort()Says whether or not a given OXC has free grooming input port(s).- Returns:
- true if the OXC has free grooming input port(s)
-
hasFreeGroomingInputPort
public boolean hasFreeGroomingInputPort(int groomingInputPort)Says whether or not a given groomingInputPort in this OXC has free- Parameters:
groomingInputPort
- id of groomingInputPort- Returns:
- true if the OXC has free grooming input port id
-
allFreeGroomingInputPort
public boolean allFreeGroomingInputPort()Says whether or not a given OXC has all free grooming input port(s).- Returns:
- true if the OXC has all free grooming input port(s)
-
reserveGroomingInputPort
public int reserveGroomingInputPort()By decreasing the number of free grooming input ports, this function "reserves" a grooming input port.- Returns:
- the number of free grooming input port, if the number is -1 is because has some error
-
releaseGroomingInputPort
public boolean releaseGroomingInputPort(int groomingInputPort)By increasing the number of free grooming input ports, this function "releases" a grooming input port. The "groomingInputPort" can be -1 when the "VirtualTopology" remove "Lightpath" that are on a optical grooming.- Parameters:
groomingInputPort
- the grooming input Port to be released- Returns:
- false if there are no grooming input ports to be freed
-
hasFreeGroomingOutputPort
public boolean hasFreeGroomingOutputPort()Says whether or not a given OXC has free grooming output port(s).- Returns:
- true if the OXC has free grooming output port(s)
-
hasFreeGroomingOutputPort
public boolean hasFreeGroomingOutputPort(int groomingOutputPort)Says whether or not a given groomingOutputPort in this OXC has free- Parameters:
groomingOutputPort
- id of groomingOutputPort- Returns:
- true if the OXC has free grooming output port id
-
allFreeGroomingOutputPort
public boolean allFreeGroomingOutputPort()Says whether or not a given OXC has all free grooming output port(s).- Returns:
- true if the OXC has all free grooming output port(s)
-
reserveGroomingOutputPort
public int reserveGroomingOutputPort()By decreasing the number of free grooming output ports, this function "reserves" a grooming output port.- Returns:
- the number of free grooming output port, if the number is -1 is because has some error
-
releaseGroomingOutputPort
public boolean releaseGroomingOutputPort(int groomingOutputPort)By increasing the number of free grooming output ports, this function "releases" a grooming output port. The "groomingOutputPort" can be -1 when the "VirtualTopology" remove "Lightpath" that are on a optical grooming.- Parameters:
groomingOutputPort
- the grooming output Port to be released- Returns:
- false if there are no grooming output ports to be freed
-
getGroomingInputPorts
public int getGroomingInputPorts() -
getFreeGroomingInputPorts
public int[] getFreeGroomingInputPorts() -
getActiveGroomingInputPorts
public int[] getActiveGroomingInputPorts() -
getGroomingOutputPorts
public int getGroomingOutputPorts() -
getFreeGroomingOutputPorts
public int[] getFreeGroomingOutputPorts() -
getActiveGroomingOutputPorts
public int[] getActiveGroomingOutputPorts() -
isSleep
public boolean isSleep()Retrieves whether the OXC is sleeping or awake- Returns:
-
getType
public int getType()Retrieves the OXC's Type.- Returns:
- the OXC's type attribute
-
getGroup
public int getGroup()Retrieves the OXC's Group.- Returns:
- the OXC's group attribute
-