Ideation Project DA Ruwe
This program provides us with an agent based simulation of an ideation game.
|
Allows objects of the class Agent
to be compared by the quality of their bestIdea.
More...
Public Member Functions | |
int | compare (Agent agent1, Agent agent2) |
A classic compare function according to Comparator . |
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!
int ideation.AgentQualityComparator.compare | ( | Agent | agent1, |
Agent | agent2 | ||
) |
-1
First agent better 0
No agent is better 1
Second agent is better