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.AgentQualityComparator Class Reference

Allows objects of the class Agent to be compared by the quality of their bestIdea. More...

Inheritance diagram for ideation.AgentQualityComparator:
Inheritance graph
[legend]
Collaboration diagram for ideation.AgentQualityComparator:
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 vector of ownedIdeas attribute of the 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.AgentQualityComparator.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