Search code examples
anylogicfuzzy-logicjfuzzylogic

How to import and use the FuzzyLogic library/package "JFML" in AnyLogic?


I'm quite new to AnyLogic, especially in importing external libraries/packages to it. Does anyone know what else do I have to do when using/importing the fuzzy java library "JFML" in AnyLogic? I imported the JFML-v1.2.2.jar file in the Model dependencies. However, e.g. if I want to execute a toString() method for a certain object of a JFML class, there is the following error:

Exception during discrete event execution:
javax/xml/bind/JAXBElement
Caused by: javax.xml.bind.JAXBElement
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBElement
    at jfml.jaxb.ObjectFactory.createKnowledgeBaseTypeFuzzyVariable(ObjectFactory.java:510)

Solution

  • According to this link it is not a simple solution for normal Java IDEs which means that is even more difficult in AnyLogic.

    What I can suggest is to download jaxb-runtime here https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime/2.3.1

    and the jakarta.xml.bind-api here https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api/4.0.0-RC3

    And add them a dependencies, same why you added the other libraries.

    it should work