Subject: RE: [jade-develop] Nested Contract Net Protocol
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Wed Nov 06 2002 - 09:17:12 MET
Hi,
The problem is that when a behaviour terminates, in order to execute it again, you have to reset it. As you use the same contractNetInitiatorBehaviour object in two states of the outer Contract Net protocol, before it can be executed in the second state (i.e. in the prepare result notification state) it must be reset.
You can try to override the onEnd() method of the inner contract net as below:
public int onEnd() {
reset();
return super.onEnd();
}
Alternatively you can use two different objects from the same class.
Bye
Giovanni
-----Original Message-----
From: Weichhart Georg [mailto:Georg.Weichhart@profactor.at]
Sent: luned́ 4 novembre 2002 8.17
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] Nested Contract Net Protocol
Dear all!
I have implemented a nested Contract Net Protocol:
(I have attached a snapshot file for better understanding)
A Wholesaler Agent (WS) sends a CFP to a Virtual Enterprise Agent (VE).
This CFP gets modified and is send to Logistics Service Provider Agents (LP)
and Manufacturing Facility Agents (MF).
The Manufacturing Facility Agents have Machine Agents (M) which in turn
receive the CFP.
The Machine Agents and the Logistic Services Agents send a PROPOSE.
The Manufacturing Facility Agents select one PROPOSE from the Machines and
forward it to the Virtual Enterprise.
The Virtual Enterprise makes a PROPOSE build from the PROPOSE Messages of
the Logistics Service Providers and the Manufacturing Facilities and send
this to the Wholesaler.
The Wholesaler now ACCEPT_PROPOSAL.
So far so good.
I have "registerPrepareResponse(ContractNetInitiatorBehaviour)" and I also
want this behaviour to
be registered for result notification -
"registerPrepareResultNotification(ContractNetInitiatorBehaviour)" so the
same behaviour handles the result notification after the machines and
logistic service providers have actually done their job.
I get the following Exception (gets thrown in a loop till the IDE crashes):
java.lang.RuntimeException: Inconsistent FSM. State: Dummy-final event: 0
at
jade.core.behaviours.FSMBehaviour.scheduleNext(FSMBehaviour.java:296)
at
jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.java:91)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:293)
at
jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.java:104)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:293)
at
jade.core.behaviours.CompositeBehaviour.action(CompositeBehaviour.java:104)
at jade.core.behaviours.Behaviour.actionWrapper(Behaviour.java:293)
at jade.core.Agent.mainLoop(Agent.java:1747)
at jade.core.Agent.run(Agent.java:1549)
at java.lang.Thread.run(Thread.java:536)
Can I still somehow do this or do I have to split the
ContractNetInitiatorBehaviour into two Behaviours?
If I do not call
"registerPrepareResultNotification(ContractNetInitiatorBehaviour)", the
Responders "prepareResultNotification" Method gets called (myAgent ==
Virtual Enterprise).
If I can't call registerPrepareResultNotification how can I in this method
pass every thing I need to the Manufacturing Facilities and Logistic Service
Providers and in turn then to the Machines?
Yours
Georg
======================================
Mr.
Georg Weichhart
Holonic and Multi Agent Systems
PROFACTOR Produktionsforschungs GmbH
Wehrgrabengasse 1-5
A-4400 Steyr
Tel: +43 (0)7252 884-225
Fax: +43 (0)7252 884-244
E-Mail: Georg.Weichhart@Profactor.at
Web: www.profactor.at
======================================
This archive was generated by hypermail 2a22 : Wed Nov 06 2002 - 09:17:13 MET