public class RouletteWheelSelectionTask extends ComputeTaskAdapter<LinkedHashMap<Long,Double>,List<Long>>
Constructor and Description |
---|
RouletteWheelSelectionTask(GAConfiguration cfg) |
Modifier and Type | Method and Description |
---|---|
@NotNull Map<ComputeJob,ClusterNode> |
map(List<ClusterNode> nodes,
LinkedHashMap<Long,Double> chromosomeKeyFitness)
This method is called to map or split grid task into multiple grid jobs.
|
List<Long> |
reduce(List<ComputeJobResult> list)
Return list of parent Chromosomes.
|
ComputeJobResultPolicy |
result(ComputeJobResult res,
List<ComputeJobResult> rcvd)
Default implementation which will wait for all jobs to complete before
calling
ComputeTask.reduce(List) method. |
public RouletteWheelSelectionTask(GAConfiguration cfg)
cfg
- GAConfiguration@NotNull public @NotNull Map<ComputeJob,ClusterNode> map(List<ClusterNode> nodes, LinkedHashMap<Long,Double> chromosomeKeyFitness) throws IgniteException
ComputeTask
nodes
- List of ClusterNode.chromosomeKeyFitness
- Map of key/fitness score pairs.IgniteException
- If mapping could not complete successfully. This exception will be
thrown out of ComputeTaskFuture.get()
method.public List<Long> reduce(List<ComputeJobResult> list) throws IgniteException
list
- List of ComputeJobResult.IgniteException
- If reduction or results caused an error. This exception will
be thrown out of ComputeTaskFuture.get()
method.public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd)
ComputeTask.reduce(List)
method.
If remote job resulted in exception (ComputeJobResult.getException()
is not null
),
then ComputeJobResultPolicy.FAILOVER
policy will be returned if the exception is instance
of ClusterTopologyException
or ComputeExecutionRejectedException
, which means that
remote node either failed or job execution was rejected before it got a chance to start. In all
other cases the exception will be rethrown which will ultimately cause task to fail.
result
in interface ComputeTask<LinkedHashMap<Long,Double>,List<Long>>
result
in class ComputeTaskAdapter<LinkedHashMap<Long,Double>,List<Long>>
res
- Received remote grid executable result.rcvd
- All previously received results.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024