Ideation Project DA Ruwe
This program provides us with an agent based simulation of an ideation game.
 All Classes Functions Variables
Public Member Functions
ideation.AgentRewardComparator Class Reference

Allows objects of the class Agent to be compared by the height of the sum of rewards rewardSum. More...

Inheritance diagram for ideation.AgentRewardComparator:
Inheritance graph
[legend]
Collaboration diagram for ideation.AgentRewardComparator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int compare (Agent agent1, Agent agent2)
 A classic compare function according to Comparator.

Detailed Description

This class creates a comparator for agents. It is based on the double rewardSum attribute of agents. Its most important use is that with Collections we can now sort a Vector<Agent> using Merge Sort (optimal) by invoking the code

Collections.sort(vec);

This saves a lot of manual iterating!

Author:
Ruediger Ruwe <ruediger.ruwe @ rwth-aachen.de>
Version:
1.0
Since:
01.08.2012

Member Function Documentation

int ideation.AgentRewardComparator.compare ( Agent  agent1,
Agent  agent2 
)
Returns:
  • -1 First agent better
  • 0 No agent is better
  • 1 Second agent is better


The documentation for this class was generated from the following file:
 All Classes Functions Variables