|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.bdi.runtime.impl.AbstractPlan
jadex.bdi.runtime.Plan
jadex.bdi.planlib.protocols.AbstractInitiatorPlan
jadex.bdi.planlib.protocols.contractnet.CNPInitiatorPlan
public class CNPInitiatorPlan
Handles the initiator side of a contract-net protocol.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jadex.bdi.runtime.Plan |
|---|
Plan.SyncResultListener |
| Field Summary | |
|---|---|
protected IMessageEvent |
me
Last sent message with convid for receiving answer messages. |
| Fields inherited from class jadex.bdi.runtime.Plan |
|---|
lis |
| Fields inherited from class jadex.bdi.runtime.impl.AbstractPlan |
|---|
interpreter, planinit |
| Constructor Summary | |
|---|---|
CNPInitiatorPlan()
|
|
| Method Summary | |
|---|---|
protected NegotiationRecord |
acceptAllProposals(NegotiationRecord nr,
ParticipantProposal[] acceptables,
java.util.Map proposalmessages)
Accept all proposals in parallel. |
protected NegotiationRecord |
acceptOneProposal(NegotiationRecord nr,
ParticipantProposal[] acceptables,
java.util.Map proposalmessages)
Sequentially accept proposals until the first successful execution. |
void |
body()
The body method is called on the instatiated plan instance from the scheduler. |
protected void |
collectProposals(NegotiationRecord nr,
java.util.Map proposalmessages)
Collect proposal messages. |
protected void |
determineFailure(NegotiationRecord nr,
ParticipantProposal[] acceptables)
Determine success or failure of the interaction. |
protected ParticipantProposal[] |
evaluateProposals(NegotiationRecord nr,
java.util.Map proposalmessages)
Determine acceptable proposals. |
protected IMessageEvent |
getInitialMessage()
Get the initial message. |
protected java.lang.String |
getShortProtocolName()
Get protocol abbrev name. |
protected boolean |
isIterated()
Test if it is the iterated contract-net version. |
protected NegotiationRecord |
queryNextroundInfo(NegotiationRecord nr)
Decide if a new iteration should be performed. |
protected void |
rejectExcludedProposals(NegotiationRecord nr,
IComponentIdentifier[] newparticipants,
java.util.Map proposalmessages)
Reject all proposals, which are not part of the next round. |
protected void |
sendCFP(NegotiationRecord nr,
java.lang.String convid)
Send the cfp message. |
| Methods inherited from class jadex.bdi.planlib.protocols.AbstractInitiatorPlan |
|---|
aborted, getTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected IMessageEvent me
| Constructor Detail |
|---|
public CNPInitiatorPlan()
| Method Detail |
|---|
public void body()
body in class Planprotected boolean isIterated()
protected java.lang.String getShortProtocolName()
protected void sendCFP(NegotiationRecord nr,
java.lang.String convid)
nr - The current negotation record.convid - The conversation id.
protected void collectProposals(NegotiationRecord nr,
java.util.Map proposalmessages)
nr - The negotiation record.proposalmessages - Map for storing the message of each current proposal (part. proposal -> message event).
protected ParticipantProposal[] evaluateProposals(NegotiationRecord nr,
java.util.Map proposalmessages)
nr - The negotiation record.proposalmessages - The received proposal messages (required to detect null proposals).
protected NegotiationRecord queryNextroundInfo(NegotiationRecord nr)
nr - The negotiation record of the current round.
protected void rejectExcludedProposals(NegotiationRecord nr,
IComponentIdentifier[] newparticipants,
java.util.Map proposalmessages)
nr - The current negotiation record.newparticipants - The remaining participants of the next round, which should not be rejected.
protected NegotiationRecord acceptAllProposals(NegotiationRecord nr,
ParticipantProposal[] acceptables,
java.util.Map proposalmessages)
nr - The current negotiation record.acceptables - The acceptable proposals.proposalmessages - The map containing proposal messages to reply to.
protected NegotiationRecord acceptOneProposal(NegotiationRecord nr,
ParticipantProposal[] acceptables,
java.util.Map proposalmessages)
nr - The current negotiation record.acceptables - The acceptable proposals.proposalmessages - The map containing proposal messages to reply to.
protected void determineFailure(NegotiationRecord nr,
ParticipantProposal[] acceptables)
nr - The final negotiation record containing executed proposals.acceptables - The acceptable proposals.protected IMessageEvent getInitialMessage()
getInitialMessage in class AbstractInitiatorPlan
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||