public final class FightBuilder<S extends Solution<?>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Comparator<EmasAgent> |
agentComparator |
private FightEnergyTransfer |
energyTransfer |
Constructor and Description |
---|
FightBuilder() |
Modifier and Type | Method and Description |
---|---|
Fight |
build() |
private io.vavr.collection.Seq<EmasAgent> |
transferEnergy(EmasAgent loser,
EmasAgent winner) |
FightBuilder<S> |
withComparator(java.util.Comparator<EmasAgent> agentComparator)
Agent comparator should return a non-negative integer if a first agent should win the fight or a negative integer if the second one should be the winner.
|
FightBuilder<S> |
withEnergyTransfer(FightEnergyTransfer energyTransfer) |
private java.util.Comparator<EmasAgent> agentComparator
private FightEnergyTransfer energyTransfer
public FightBuilder<S> withComparator(java.util.Comparator<EmasAgent> agentComparator)
Agent comparator should return a non-negative integer if a first agent should win the fight or a negative integer if the second one should be the winner.
agentComparator
- the agent comparatorpublic FightBuilder<S> withEnergyTransfer(FightEnergyTransfer energyTransfer)
public Fight build()