Genius is a Java-based negotiation platform to develop general negotiating agents and create negotiation scenarios. The platform can simulate negotiation sessions and tournaments and provides analytical tools to evaluate the agents’ performance
Genius is used in academic research and the international negotiation competition ANAC. In this article IntelliJ is selected to try this Package.
After download Genius, can directly double click file genius-**.jar, open a GUI
After install IntelliJ and configure the system java environment.
How to develop a new Agent in IntelliJ
Start a new Java project on IntelliJ
Add downloaded genius-9.1.11.jar to the project classpath. In “Idea” you can do that by adding it as a library in Module settings (Figure Configuration used for developing the Agent).
Create a new class called SimpleAgent.java and then extend it from the negotiator.Agent class and implement the abstract method called chooseAction(). This method is called whenever our agent needs to perform an action. (i.e.: When the opponent has proposed a bid to the negotiation space, and it’s the turn of our SimpleAgent to either accept it or propose a new bid, then this method will be called.)
Configuration used for developing the Agent
Here is a example Agent created by Malintha Fernando
@Override public Action chooseAction(){ ActionType lActionType = getActionType(actionOfPartner); Action lMyAction = null; try { switch (lActionType) { case OFFER: Offer loffer = ((Offer) actionOfPartner); System.out.println("Opponent's last bid = " + loffer.getBid().toString()); if (myLastAction == null) { //this is opponent's initial offer (y0) if (utilitySpace.getUtility(loffer.getBid()) == 1) { lMyAction = new Accept(getAgentID(), loffer.getBid()); //i generate my initial offer } else { lMyAction = generateInitialOffer(); } } elseif (utilitySpace.getUtility(loffer.getBid()) >= utilitySpace.getUtility(((Offer) myLastAction).getBid())) { lMyAction = new Accept(getAgentID(), loffer.getBid()); //generate counter offer } else { lMyAction = generateCounterOffer(); } break; case ACCEPT: break; case BREAKOFF: break; //I am starting default: if (myLastAction == null) { log.info("###default###" + lActionType.name()); lMyAction = generateInitialOffer(); } else { // simply repeat last action lMyAction = myLastAction; myLastBid = ((Offer) myLastAction).getBid(); } break; } } catch (Exception e) { e.printStackTrace(); } myLastAction = lMyAction; return lMyAction; }
public Action generateInitialOffer()throws Exception { returnnew Offer(getAgentID(), getBidRandomWalk()); }
public Action generateCounterOffer()throws Exception { returnnew Offer(getAgentID(), getBidRandomWalk()); }
public Bid getBidRandomWalk(){ return utilitySpace.getDomain().getRandomBid(new Random());
} }
Then compile the project get the SimpleAgent class, open the GUI of Genius, Java -jar genius-9.1.11.jar add the new Agent use class file. (Figure Add New Agent)
Add New Agent
If everything is fine, the can create a negotiation or tournament, use our Agent.
Lucky enough, one of our agents will accept the random bid of the opponent to reach an equilibria.