Donnerstag, 6. Juni 2013

New project: Optaplanner - Getting started

Today I have started to work with OptaPlanner. To say the truth, I already started reading the documentation a few days ago. But today I wanted to start implementing a first application.

So what is OptaPlanner and why do I want to test it. My first contact with OptaPlanner had been a few weeks ago, when looking for planning and optimization frameworks based on Java. Currently the system I am developing is using a Java implementation of FF planner - the implementation is pure and very hard to maintain. This is the reason I am looking for a better more flexible solution of a planning system. I am not sure if OptaPlanner fulfills the requirements. At the moment I am formulating my problems using PDDL (Planning Domain Definition Language). But I will talk about this later.

So now lets get started - or rather lets get the examples running. First we create a new eclipse maven project. Next we add the optaplanner core dependency:

    <dependency>
        <groupId>org.optaplanner</groupId>
        <artifactId>optaplanner-core</artifactId>
        <version>${optaplanner.version}</version>
    </dependency>


The version I am using is 6.0.0.Beta3. Next thing I wanted to do is to add the example sources of the optaplanner homepage. So after downloading and extracting the archive, we just copy the source code into the eclipse project... and get a lot of problems.

One problem is the missing XStreamScoreConverter class, which is part of the optaplanner-benchmark module. Hence, we add this one to the project, which solve some of our problems. But still we have some more errors. Some missing classes of the org.jdom package are the problem. So we have to add one more dependency (I got the version information from the example module of optaplanner).

    <dependency>
        <groupId>org.jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.1</version>
    </dependency>

...and finally no more problems. Getting the examples to work require two more things. First you have to copy the resources into your eclipse resource folder. Second you have to copy the example data (the folder is named data as well) into your project. That's it. Now I could finally run the examples and inspect the source code. As you can see in the following picture everything works fine for me now.


So that's it for now... more to come... I will try to understand what is happing and how it works.

Keine Kommentare:

Kommentar veröffentlichen