public abstract class Router
extends java.lang.Object
A custom router that extends this abstract class must implement the initialize method in order to proper set the different router architectures
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.Integer,Crossing> |
crossings
The map containing the crossing objects
|
protected java.util.HashMap<java.lang.Integer,MicroringResonator> |
rings
The map containing the ring objects
|
protected java.util.HashMap<java.lang.Integer,Waveguide> |
waveguides
The map containing the waveguide objects
|
Constructor and Description |
---|
Router(int numPorts,
int numRings,
int numCrossings,
int numWaveguides,
javax.swing.JTextArea textArea)
Constructs Router with a certain number of ports, microring resonators,
crossings and waveguides.
|
Router(int numRings,
int numCrossings,
int numWaveguides,
javax.swing.JTextArea textArea)
Constructs a five port Router with a certain number of microring
resonators, crossings and waveguides.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areSharedWaveguides(java.util.List<BuildingBlock> path_i,
java.util.List<BuildingBlock> path_j)
Evaluates if two paths contain the same waveguide.
|
java.lang.String |
connectivityMatrixToString() |
java.lang.String |
crosstalkMatrixToString() |
java.util.HashMap<java.lang.Integer,Crossing> |
getCrossings() |
double[][][][] |
getCrosstalkMatrix() |
double[][] |
getLossMatrix() |
int |
getNumCrossings() |
int |
getNumPorts() |
int |
getNumRings() |
int |
getNumWaveguides() |
java.lang.String |
getReadableRepresentation() |
java.util.HashMap<java.lang.Integer,MicroringResonator> |
getRings() |
java.util.HashMap<java.lang.Integer,Waveguide> |
getWaveguides() |
protected abstract void |
initialize()
Initializes the router object.
|
boolean |
isValidSimultaneousCommunication(int p_in0,
int p_out0,
int p_in1,
int p_out1)
Evaluates if two concurrent communications are feasible
|
java.lang.String |
lossMatrixToString() |
void |
printCrosstalk()
Prints the crosstalk matrix
|
void |
printLoss()
Prints the loss matrix
|
protected java.util.HashMap<java.lang.Integer,MicroringResonator> rings
protected java.util.HashMap<java.lang.Integer,Crossing> crossings
protected java.util.HashMap<java.lang.Integer,Waveguide> waveguides
public Router(int numRings, int numCrossings, int numWaveguides, javax.swing.JTextArea textArea)
numRings
- the number of microring resonatorsnumCrossings
- the number of crossingsnumWaveguides
- the number of waveguidestextArea
- the GUI element used to print messagespublic Router(int numPorts, int numRings, int numCrossings, int numWaveguides, javax.swing.JTextArea textArea)
numPorts
- the number of portsnumRings
- the number of microring resonatorsnumCrossings
- the number of crossingsnumWaveguides
- the number of waveguidestextArea
- the GUI element used to print messagesprotected abstract void initialize()
public boolean isValidSimultaneousCommunication(int p_in0, int p_out0, int p_in1, int p_out1)
p_in0
- the input port of communication 0p_out0
- the output port of communication 0p_in1
- the input port of communication 1p_out1
- the output port of communication 1true
if the two communication don't share any
waveguide; false
otherwisepublic boolean areSharedWaveguides(java.util.List<BuildingBlock> path_i, java.util.List<BuildingBlock> path_j)
path_i
- the list containing all the building blocks that are crossed
by the signal ipath_j
- the list containing all the building blocks that are crossed
by the signal jtrue
if the two paths share at least a single
waveguide; false
otherwisepublic java.lang.String connectivityMatrixToString()
public java.lang.String lossMatrixToString()
public java.lang.String crosstalkMatrixToString()
public java.lang.String getReadableRepresentation()
public void printLoss()
public void printCrosstalk()
public int getNumPorts()
public int getNumWaveguides()
public int getNumCrossings()
public int getNumRings()
public java.util.HashMap<java.lang.Integer,MicroringResonator> getRings()
public java.util.HashMap<java.lang.Integer,Crossing> getCrossings()
public java.util.HashMap<java.lang.Integer,Waveguide> getWaveguides()
public double[][] getLossMatrix()
public double[][][][] getCrosstalkMatrix()