|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.upb.swtpra05.group03.shuttle.MasterShuttleNegotiation
ShuttleModule which is responsible for the acquisition of new orders for the shuttle. This implementation represents the "MasterShuttleStrategy", that is that:
OrderAvailable message
by calculating their offer prices by evaluating selfcosts and adding margin
and risk addition and send the offer prices to the master shuttleYouHaveWonMessage YouHaveWonMessage send an offer
to the kernel
| Field Summary | |
protected ActivityControllerInterface |
activityController
The strategy control |
protected ShuttleControlInterface |
agent
the shuttle control |
private boolean |
allowMaxOffer
if set true, maxOffers are able to be used. |
protected java.util.Map |
bestOfferPrices
Map of BestShuttleOfferPrice with an order id as key |
protected CompanyInterface |
company
The company |
protected java.util.Map |
evaluatedSelfcosts
Map of wakeUpTimes and lists of ExtendedOrders for which selfcosts were evaluated, so they should as fast as possible be removed if we don't offer for them. |
private boolean |
forceMaxOffer
if set true, the shuttle will always send MaxOffer |
private static java.util.logging.Logger |
log
Logger for debugging |
protected MarginControllerInterface |
marginController
the margin controller |
private java.util.Random |
maxOfferRandom
Randomizer to send the Maxoffer |
protected int |
maxOrderCount
Maximum number of order we should execute. |
protected OfferingControlInterface |
offeringControl
The offering control |
protected static int |
OFFERPRICE_SENDTIME
Time between the sending of a offerPrice message and the possible receiving of a YouHaveWonMessage |
protected OrderContainerInterface |
orderContainer
the extended order container |
protected int |
orderCount
count of orders the shuttle is working on |
protected OrderEvaluaterInterface |
orderEvaluater
The order evaluater |
protected RiskControlInterface |
riskControl
The risk control |
protected SCCCalculatorInterface |
sccCalculator
The strong connection components calculator |
static int |
STRATEGY
The strategy of this negotiation implementation |
protected StrategyControlInterface |
strategyControl
The strategy control |
protected UnsuccessfulOfferInterface |
unsuccessfulOffer
The unsuccessful offer module(s) |
| Constructor Summary | |
MasterShuttleNegotiation()
Constructor for MasterShuttleNegotiation |
|
| Method Summary | |
protected int |
calculateOfferPrice(ExtendedOrder eo)
|
protected void |
checkAllOfferPricesReceived(java.lang.Integer orderId,
BestShuttleOfferPrice bestOfferPrice)
|
int |
getMaxOrderCount()
Returns the max order count. |
int |
getOrderCount()
Returns the order count. |
protected int |
getRandomMaxOffer(ExtendedOrder eo)
|
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. |
protected void |
offerPriceMessage(OfferPriceMessage msg)
If we are the MasterShuttle update best shuttle offerPrice and if we have the offerPrice of all shuttles send the YouHaveWonMessage
to the shuttle with the best offerPrice. |
protected void |
orderAvailable(de.upb.swtpra.kernel.message.OrderAvailable msg)
Send offer price of the order to the masterShuttle. |
protected void |
sendEvaluatedSelfcostsRemoveWakeUpRequest(ExtendedOrder eo,
int curTime)
|
protected void |
sendYouHaveWon(int orderId,
de.upb.swtpra.kernel.id.ID bestShuttle)
|
void |
setMaxOrderCount(int orderCount)
Sets the max order count. |
protected void |
shuttleCountReduced()
|
protected void |
turnierMessage(TurnierMessage msg)
sets if the shuttle sends maxOffers |
protected void |
updateOfferPrices(java.lang.Integer orderId,
de.upb.swtpra.kernel.id.ID shuttleID,
int selfcosts)
Update best offerPrice for given orderId, shuttle and offerPrice. |
protected void |
wakeUpCall(de.upb.swtpra.kernel.message.WakeUpCallMessage msg)
|
protected void |
youHaveWonMessage(YouHaveWonMessage msg)
Calculates the price to offer and sends the offer to the kernel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int STRATEGY
protected static final int OFFERPRICE_SENDTIME
protected int maxOrderCount
protected final java.util.Map evaluatedSelfcosts
protected final java.util.Map bestOfferPrices
BestShuttleOfferPrice with an order id as key
protected int orderCount
protected ShuttleControlInterface agent
protected OrderContainerInterface orderContainer
protected MarginControllerInterface marginController
protected SCCCalculatorInterface sccCalculator
protected RiskControlInterface riskControl
protected OfferingControlInterface offeringControl
protected StrategyControlInterface strategyControl
protected OrderEvaluaterInterface orderEvaluater
protected UnsuccessfulOfferInterface unsuccessfulOffer
protected ActivityControllerInterface activityController
protected CompanyInterface company
private static final java.util.logging.Logger log
private java.util.Random maxOfferRandom
private boolean forceMaxOffer
private boolean allowMaxOffer
| Constructor Detail |
public MasterShuttleNegotiation()
| Method Detail |
public void init(ModuleContainerInterface container)
Module
init in interface Modulecontainer - The module manager which contain all modulespublic int getOrderCount()
public void setMaxOrderCount(int orderCount)
orderCount - The new max order countpublic int getMaxOrderCount()
public void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
ShuttleModule
newMessageReceived in interface ShuttleModulemsg - The received message of the shuttleprotected void wakeUpCall(de.upb.swtpra.kernel.message.WakeUpCallMessage msg)
msg - protected void turnierMessage(TurnierMessage msg)
msg - the turniermessageprotected void orderAvailable(de.upb.swtpra.kernel.message.OrderAvailable msg)
msg - The OrderAvailable messageprotected int calculateOfferPrice(ExtendedOrder eo)
eo -
protected void sendEvaluatedSelfcostsRemoveWakeUpRequest(ExtendedOrder eo,
int curTime)
eo - curTime - protected int getRandomMaxOffer(ExtendedOrder eo)
eo - extendedorder
protected void youHaveWonMessage(YouHaveWonMessage msg)
msg - The YouHaceWonMessageprotected void offerPriceMessage(OfferPriceMessage msg)
YouHaveWonMessage
to the shuttle with the best offerPrice.
msg - The OfferPriceMessage
protected void updateOfferPrices(java.lang.Integer orderId,
de.upb.swtpra.kernel.id.ID shuttleID,
int selfcosts)
orderId - shuttleID - selfcosts -
protected void checkAllOfferPricesReceived(java.lang.Integer orderId,
BestShuttleOfferPrice bestOfferPrice)
orderId - bestOfferPrice -
protected void sendYouHaveWon(int orderId,
de.upb.swtpra.kernel.id.ID bestShuttle)
orderId - bestShuttle - protected void shuttleCountReduced()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||