public class MatchResult extends Object implements Serializable, Comparable<MatchResult>
The result of a MatchFunction
. If the description of the requesting
agent matches the team description, this result is returned. It contains the
identifier of the team manager and the distance to the team description.
Furthermore, the result contains the time at which the team has been
established. This parameter helps find the oldest team if there is more than
one match with the same distance.
The order in which results are compared to each other is as follows:
As soon as the first pair of elements is unequal, the respective comparison result is returned.
Note that considering the name of the manager ensures reproducibility of results are equal otherwise.
MatchFunction
,
Serialized FormConstructor and Description |
---|
MatchResult(AgentIdentifier manager,
double distance,
Timestamp established)
Instantiates this match result.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MatchResult other) |
boolean |
equals(Object object) |
double |
getDistance()
Returns the distance to the matching team.
|
Timestamp |
getEstablished()
Returns the time at which the team has been established.
|
AgentIdentifier |
getManager()
Returns the manager of the matching team.
|
int |
hashCode() |
public MatchResult(AgentIdentifier manager, double distance, Timestamp established)
manager
- the manager of the matching teamdistance
- the distance to the matching teamestablished
- the time at which the team has been establishedNullPointerException
- if the manager is nullIllegalArgumentException
- if the distance is less than zeroNullPointerException
- if the established timestamp is null
public AgentIdentifier getManager()
public double getDistance()
public Timestamp getEstablished()
public int compareTo(MatchResult other)
compareTo
in interface Comparable<MatchResult>
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.