Share

Jadex BDI Agent System

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Internal event not handled

  1. 2006-06-11 08:56:03 UTC
    Hi!

    I have a problem with an internal event ,dispatch by the inner capability, not being handled.
    The internal event is declared in the inner capability:

    <capability xmlns="http://jadex.sourceforge.net/jadex"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jadex.sourceforge.net/jadex
    http://jadex.sourceforge.net/jadex-0.94.xsd"
    name="Test"
    package="ac.test">

    <goals>
    <performgoal name="change_caste">
    </performgoal>
    </goals>

    <plans>

    <plan name="changecaste">
    <body>new TestPlan()</body>
    <trigger>
    <messageevent ref="castechange"/>
    </trigger>
    </plan>

    </plans>

    <events>
    <internalevent name="caste_change" type="exported">
    </internalevent>

    <messageevent name="castechange" direction="send_receive" type="fipa">
    <parameter name="performative" class="String" direction="fixed">
    <value>SFipa.REQUEST</value>
    </parameter>
    <parameter name="content-start" class="String" direction="fixed">
    <value>"change caste"</value>
    </parameter>
    </messageevent>
    </events>

    </capability>

    In TestPlan,the internal event is generated and dispatched using this code:

    IInternalEvent event = this.createInternalEvent("caste_change");
    dispatchInternalEvent(event);

    TestAgent use the test capability,and reference the internal event:

    <agent xmlns="http://jadex.sourceforge.net/jadex"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jadex.sourceforge.net/jadex
    http://jadex.sourceforge.net/jadex-0.94.xsd"
    name="TestAgent"
    package="ac.test">

    <capabilities>
    <capability name="test" file="ac.test.Test"/>
    </capabilities>


    <plans>
    <plan name="change_caste">
    <body>new DoTestPlan()</body>
    <trigger>
    <internalevent ref="caste_change"/>
    </trigger>
    </plan>
    <plan name="changecaste">
    <body>new TestEventPlan()</body>
    <trigger>
    <messageevent ref="requestcastechange"/>
    </trigger>
    </plan>
    </plans>

    <events>

    <internaleventref name="caste_change">
    <concrete ref="test.caste_change"/>
    </internaleventref>
    </events>

    </agent>


    This gives me the error:

    2006-6-11 15:29:12 jadex.runtime.impl.agenda.eventprocessing.ProcessEve
    eventNotHandled
    WARNING: event not handled: TestAgent RInternalEvent(type=caste_change)

    Could you give me suggestions?

  2. 2006-06-12 08:11:48 UTC
    Hi chuw,

    it depends on the scope in which the event is created to which extent it can be seen in the system. Generally, we tried to achieve that a capability is self-contained and has an encapsulated state. Hence, if you create the internal event in the inner capability it will only be visible there and not in the outer capability. If you create the event in the outer capability it will be visible in the outer and inner capability.

    If you want to achieve that the internal event is created in the inner capability and becomes visible also in the outer you need to declare the internal event abstract in the inner capability and assign it from the outer capability.

    Details of the creation semantics for elements in capabilities can be found here:
    http://vsis-www.informatik.uni-hamburg.de/projects/jadex/jadex-0.94x/userguide/index.single.html#capabilities

    and in the paper:
    http://vsis-www.informatik.uni-hamburg.de/projects/jadex/papers/braubach_capabilities.pdf

    Best regards,
    Lars
  3. 2006-06-13 14:59:55 UTC
    Thanks Lars!
  4. 2006-06-21 06:41:29 UTC
    Hi,

    we have encountered this kind of error several times by ourselves when building applications. Hence we think about realizing a "strong export" setting which would create the event also in the outer capability (maybe this behaviour could also be the default?). In our opinion the benefits may outweigh the negative aspects by breaking a capability's encapsulation? What do you think?

    Best regards,
    Lars
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.