|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.upb.swtpra05.group03.shuttle.RiskControl
Controls the risk level of the shuttle and calculates the risk addition of an order according to its riskiness.
| Field Summary | |
private ExecutionInterface |
execution
The reference to Execution |
private static java.util.logging.Logger |
log
Logger for debugging |
protected float[] |
maxOrderRisk
The maximal order risk at which we should offer for the order |
private OrderContainerInterface |
orderContainer
The order container |
protected int |
reserveDefConnections
Number of connections at which we add the complete time reserve |
protected float |
reserveFactor
factor by which the time reserve is inremented for each order in line |
protected int |
reserveMinConnections
Number of connections before we add a time reserve |
protected int |
riskLevel
The current risk level of the our company |
protected float[] |
slope
The factor order risk is multiplied with to calculate the risk factor |
private TaskPlanInterface |
taskPlan
the current taskPlan |
protected int[] |
timeReserve
The time reserve between the order finished time and order limit time |
protected float[] |
zero
The order risk from which upwards we add a risk addition |
| Fields inherited from interface de.upb.swtpra05.group03.shuttle.RiskControlInterface |
ERROR, HIGH_RISK, LOW_RISK, MEDIUM_RISK |
| Constructor Summary | |
RiskControl()
Constructor |
|
| Method Summary | |
protected float |
calculateLevelRisk(float risk)
|
protected float |
calculateOrderRisk(ExtendedOrder eo)
calculates the risk value of the order |
float |
calculateRisk(ExtendedOrder eo)
Calculates the risk addition of an order according to its riskiness. |
int |
getCurrentRiskLevel()
Returns the current risk level. |
void |
init(ModuleContainerInterface container)
Initializes this module. |
void |
newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
React on the received message of the shuttle or not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.util.logging.Logger log
protected int riskLevel
private ExecutionInterface execution
private OrderContainerInterface orderContainer
protected final float[] zero
protected final float[] slope
protected final float[] maxOrderRisk
protected final int[] timeReserve
protected final float reserveFactor
protected final int reserveMinConnections
protected final int reserveDefConnections
private TaskPlanInterface taskPlan
| Constructor Detail |
public RiskControl()
| Method Detail |
public void init(ModuleContainerInterface container)
Module
init in interface Modulecontainer - The module manager which contain all modulespublic float calculateRisk(ExtendedOrder eo)
RiskControlInterface
calculateRisk in interface RiskControlInterfaceeo - order to calculate the risk addition for
protected float calculateLevelRisk(float risk)
risk -
public int getCurrentRiskLevel()
RiskControlInterface
getCurrentRiskLevel in interface RiskControlInterfaceprotected float calculateOrderRisk(ExtendedOrder eo)
eo - the order to check
public void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
ShuttleModule
newMessageReceived in interface ShuttleModulemsg - The received message of the shuttle
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||