38#ifndef UWMULTI_STACK_CONTROLLER_H
39#define UWMULTI_STACK_CONTROLLER_H
86 virtual int command(
int,
const char*
const*);
94 virtual void addLayer(
int id,
int order);
104 virtual void addThreshold(
int i,
int j,
double thres_ij);
111 virtual void recv(Packet *p);
133 order2id.find(layer_order)->second; }
198 virtual bool getThreshold(
int i,
int j,
double& thres_ij);
Class used to represents the UwMultiStackController layer of a node.
virtual void addThreshold(int i, int j, double thres_ij)
set the threshold value for the transition from layer i to layer j, checking first whether the layers...
int debug_
Flag to activate debug verbosity.
int getOrder(int layer_id)
return the order of the id for the controller logic
virtual int getBestLayer(Packet *p)
Return the best layer to forward the packet when the system works in AUTOMATIC_MODE.
virtual ~UwMultiStackController()
Destructor of UwMultiPhy class.
@ UW_AUTOMATIC_SWITCH
State to switch-mode automatically.
@ UW_MANUAL_SWITCH
State to switch-mode manually.
std::map< int, int > order2id
Return the layer order given its order in the threshold matrix.
virtual void addLayer(int id, int order)
Add a layer in the layer map.
virtual double getMetricFromSelectedLowerLayer(int id, Packet *p)
return the new metrics value obtained from the selected lower layer, in proactive way via ClMessage
virtual int command(int, const char *const *)
TCL command interpreter.
int lower_id_active_
<Current switch mode (either AUTOMATIC or MANUAL).
virtual void eraseThreshold(int i, int j)
remove the threshold value for the transition from layer i to layer j, checking first whether the lay...
virtual void recv(Packet *p)
recv method.
static int const layer_not_exist
This constant is returned when a searched layer does not exist>
virtual bool isLayerAvailable(int id)
return if the specified layer, identified by id, is available
UwMultiStackController()
Constructor of UwMultiPhy class.
virtual void recvFromUpperLayers(Packet *p)
By default the signaling is not employed, if it is needed, here where to set the signaling packet siz...
ThresMatrix threshold_map
Returns the switch layer theshold given a layer order.
void setThreshold(int i, int j, double thres_ij)
set the threshold value for the transition from layer i to layer j
virtual bool getThreshold(int i, int j, double &thres_ij)
get the threshold value for the transition from layer i to layer j, checking first whether the layers...
std::map< int, int > id2order
Maps each layer id to its order in the threshold matrix.
int getId(int layer_order)
return the id of the controlled layer given its order in the controller logic
std::map< int, double > ThresMap
Threshoold map <PHY_order, threshold>
std::map< int, ThresMap > ThresMatrix
Thresholds matrix.