Kalah competition classpath

Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.

Kalah competition classpath
I’m sorry but I’m not that experienced in programming with java. Could someone please quickly explain to me whats meant by

“please put your agent in the classpath info.kwarc.teaching.AI.Kalah.WS1920.agents
If you use additional objects/classes, please put them in a unique namespace extending info.kwarc.teaching.AI.Kalah.WS1920.agents”

from the readme file of the kalah github project
Thanks!


I don’t know Java that well myself, but here is how I understand it:

If you have an agent RiwoAgent, you shoud have a file RiwoAgent.java, which looks roughly like this:

    package info.kwarc.teaching.AI.Kalah.WS1920.agents;
    import info.kwarc.teaching.AI.Kalah.Agents.Agent;
    import info.kwarc.teaching.AI.Kalah.util.*;
    public class RiwoAgent extends Agent {    ....    }

the important part here is the first line that sets the package.

You may also have some helper classes. To avoid collisions with helper classes by other agents, you should put them in a special package, like this:

    package info.kwarc.teaching.AI.Kalah.WS1920.agents.riwoagent;
    public class Helper {    ....    }

I think that the folder structure should also match the package name.

Important: the class name [m]RiwoAgent[/m] and the class path extension [m]riwoagent[/m] should be chosen uniquely (i.e. in a way that nobody else will choose it).

I hope this helps :slight_smile:


Yes this helped a lot. Thanks!