Menu

Could not link

Help
2015-04-15
2015-04-17
  • Jakub Miško

    Jakub Miško - 2015-04-15

    I am testing simple agent:
    <beliefs>
    <belief name="read" class="Boolean">
    <fact>true</fact>
    </belief>
    <belief name="wait" class="Boolean">
    <fact>false</fact>
    </belief>
    </beliefs>
    <performgoal name="read" retry="true">
    <contextcondition language="jcl">$beliefbase.read == true</contextcondition>
    </performgoal>
    <achievegoal name="wait">
    <createcondition>$beliefbase.wait == true</createcondition>
    <targercondition>$beliefbase.read == false</targercondition>
    </achievegoal>
    <plans>
    <plan name="write">
    <body class="Write"/>
    <trigger>
    <goal ref="read"/>
    </trigger>
    </plan>
    <plan name="wait">
    <body class="Wait"/>
    </plan>
    </plans>
    <configurations>
    <configuration name="default">
    <goals>
    <initialgoal ref="read"/>
    </goals>
    <plans></plans>
    </configuration>
    </configurations>
    and JCC says:
    Summary
    XML errors
    $beliefbase.wait == true has errors.
    $beliefbase.read == false has errors.
    Goal errors
    performgoal init has errors.
    performgoal read has errors.
    achievegoal wait has errors.
    XML details
    $beliefbase.wait == true errors:
    Could not link: $beliefbase.wait == true machievegoal_1@2061251267 (line 48, column 20)
    $beliefbase.read == false errors:
    Could not link: $beliefbase.read == false machievegoal_1@2061251267 (line 49, column 20)
    Goal details
    performgoal init errors:
    Could not link: mperformgoal_1@2061251267 magent_1@2061251267 (line 32, column 27)
    performgoal read errors:
    Could not link: mperformgoal_2@2061251267 magent_1@2061251267 (line 37, column 56)
    achievegoal wait errors:
    $beliefbase.wait == true
    Could not link: $beliefbase.wait == true machievegoal_1@2061251267 (line 48, column 20)
    $beliefbase.read == false
    Could not link: $beliefbase.read == false machievegoal_1@2061251267 (line 49, column 20)
    Could not link: machievegoal_1@2061251267 magent_1@2061251267 (line 47, column 27)

    is there some limitations on goals conditions that im violating?

     
  • Alexander Pokahr

    Hi,

    is this a complete XML snippet?

    I saw that you are missing the <goals>...</goals> tag.

    Please check your XML structure and if the error persists, please post a complete
    XML that reproduces the problem.

    Cheers,
    Alex

     
  • Jakub Miško

    Jakub Miško - 2015-04-17

    it was reduced because i didnt wanted to make long post, here is full xml
    <?xml version="1.0" encoding="UTF-8"?>
    <agent name="a" package="sk.tuke.fei.bdi.jakub" xmlns="http://jadex.sourceforge.net/jadex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jadex.sourceforge.net/jadex &lt;a href=" http:="" jadex.sourceforge.net="" jadex-bdi-2.4.xsd"="">http://jadex.sourceforge.net/jadex-bdi-2.4.xsd">
    <beliefs>
    <belief name="read" class="Boolean">
    <fact>true</fact>
    </belief>
    <belief name="wait" class="Boolean">
    <fact>false</fact>
    </belief>
    </beliefs>
    <goals>
    <performgoal name="read" retry="true">
    <contextcondition language="jcl">$beliefbase.read == true</contextcondition>
    </performgoal>
    <achievegoal name="wait">
    <createcondition>$beliefbase.wait == true</createcondition>
    <targercondition>$beliefbase.read == false</targercondition>
    </achievegoal>
    </goals>
    <plans>
    <plan name="write">
    <body class="Write"/>
    <trigger>
    <goal ref="read"/>
    </trigger>
    </plan>
    <plan name="wait">
    <body class="Wait"/>
    </plan>
    </plans>
    <configurations>
    <configuration name="default">
    <goals>
    <initialgoal ref="read"/>
    </goals>
    <plans>
    </plans>
    </configuration>
    </configurations>
    </agent>

     
  • Alexander Pokahr

    Hi,

    thanks for the complete file.

    I found two typos: 'createcondition' should be 'creationcondition', 'targercondition' should be 'targetcondition'.

    You might want to check, if your IDE supports XML validation.
    E.g. in eclipse you can also use auto completion in agent XMLs,
    which simplifies development a lot.

    Cheers,
    Alex

     

Log in to post a comment.