Skip to content

micss-lab/FuzzyBDIAgents

Repository files navigation

Fuzzy-BDI Reasoning on BDI Agents

This is the repo to provide supplementary material for the reproducibility of the fuzzy-BDI approach.

Deployment Steps

Requirement: Before term definitions and action mappings, there must be sensor and motor configuration of the BrickPI API. The current environment configuration already applies this.

  1. Go to the folder using a Terminal cd Inside the root folder, run: ant -f bin/build.xml jar or ant -f bin/productionLine.xml jar

Hint: If it fails to close the MAS Console when the JAR build is run, modify the .xml file inside the bin folder as follows.

=================================================

<fileset dir="${basedir}">
                <include name="**/*.asl" />
                <include name="**/*.mas2j" />
                <include name="logging.properties" /> -> Add this line.
</fileset>

=================================================
Extra information:

handlers = jason.runtime.MASConsoleLogHandler -> Opens Java-Swing based console acar.

#handlers= java.util.logging.ConsoleHandler -> Prints to the black-screen console (not Swingx)

Hint: Inside the .xml folder, a few parameters must be altered. Sample configuration for running the agents as distributed using the JADE infrastructure provided by Jason. -gui parameter must be deleted.

It is also important that for each different environment, the name of the environment must be altered, such as for container 1 it is j_environment:jason.infra.jade.JadeEnvironment, and for container two, it is j2_environment:jason.infra.jade.JadeEnvironment

=============================================

<target name="Main-Container" depends="compile" >
        <echo message="Starting JADE Container Main-Container" />
        <java classname="jade.Boot" failonerror="true" fork="yes" dir="${basedir}" >
            <classpath refid="project.classpath"/>
            <arg line="-agents j_environment:jason.infra.jade.JadeEnvironment(j-project,productionLine.mas2j);initAgent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,initAgent);dropAgent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,dropAgent);shredAgent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,shredAgent);sortAgent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,sortAgent)"/>
            <jvmarg line="-Xmx500M -Xss8M"/>
        </java>
    </target>

    <target name="c1" depends="compile" >
        <echo message="Starting JADE Container c1" />
        <java classname="jade.Boot" failonerror="true" fork="yes" dir="${basedir}" >
            <classpath refid="project.classpath"/>
            <arg line="-container -host 192.168.0.119 -container-name c1  -agents  j2_environment:jason.infra.jade.JadeEnvironment(j-project,productionLine.mas2j);init2Agent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,init2Agent);buildAgent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,buildAgent);pushAgent:jason.infra.jade.JadeAgArch(j-project,productionLine.mas2j,pushAgent)"/>
            <jvmarg line="-Xmx500M -Xss8M"/>
        </java>
    </target>

=================================================

  1. Send the application to the RaspberryPI 3

The command for sending the applicationName.JAR to the RaspberryPI 3 over the network, the following command can be used.

pscp -pw "password" applicationName.jar robot@IP_ADDRESS_RP3:/home/robot 

  1. Run the .JAR application
java -jar applicationName.java 

Technical Notes

As indicated during our development, there were certain challenges encountered during the implementation of the production line system. These challenges are worth mentioning as they provide insights into the practical aspects and considerations of our study. Since the system was constructed using Jason, JADE, and BrickPI API (Java), managing all these technologies was burdensome. At first, Jason's agent-programming environment is set to JADE environment mode. Because Jason benefits from JADE infrastructure to create a distributed topology for communication, to activate distributed agent topology, this option should be given in .masj file. Then, infrastructure: Jade(main_container_host("IP address")) parameter should be given to state that the target IP address has the main container. After that, the other JADE containers can register themselves to the main container via this target IP address. We also experienced that versions after Eclipse 2020-03 have a bug, and build.xml file cannot be generated by these later versions. Therefore, we switched back to the 2020-03 version. After that, we encounter Java.swingx errors generated by BrickPI. We recognized that BrickPI does not support any graphical-based Java implementation. Therefore, we switched Jason to the console mode using handlers= java.util.logging.ConsoleHandler. However, there was another bug: the build.xml file does not include logging.properties file. Therefore, we added include name= "logging.properties" parameter after the include name="**/*.mas2j" parameter. When we switched to JADE infrastructure mode, we re-encountered with java.swingx problem. Therefore, inside the build.xml file, we deleted the -gui parameter. We then sent the project files to RaspberryPI 3. We installed the Ant compiler and used ant -f projectName.xml Main-Container to run our application. To run the other containers, their names should be used as projectName.xml "other container name". We hope the technical problems we have encountered during the implementation and provided solutions can help the researchers, developers and practitioners.

Further Reading

  • The study (Karaduman et al., 2023) provides further insights into how to build a product line system using Lego Technology and its agent-based design.
  • The study (Karaduman et al., 2021) presents further insights into the process steps of building a complex CPS, such as the smart production line system and its integration with the agents.

Karaduman, B., Kardas, G., & Challenger, M. (2023). Development of Autonomous Cyber-Physical Systems Using Intelligent Agents and LEGO Technology. In Cyber-Physical Systems for Industrial Transformation (pp. 193-211). CRC Press.

Karaduman, B., David, I., & Challenger, M. (2021, October). Modeling the engineering process of an agent-based production system: An exemplar study. In 2021 ACM/IEEE International Conference on Model Driven Engineering Languages and Systems Companion (MODELS-C) (pp. 296-305). IEEE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published