Class NBodyTask

java.lang.Object
org.episteme.server.server.tasks.physics.nbody.NBodyTask
All Implemented Interfaces:
Serializable, DistributedTask<NBodyTask, NBodyTask>

@AutoService(DistributedTask.class) public class NBodyTask extends Object implements DistributedTask<NBodyTask, NBodyTask>
N-Body Simulation Task.
See Also:
  • Constructor Details

  • Method Details

    • setMode

      public void setMode(TaskRegistry.PrecisionMode mode)
    • getInputType

      public Class<NBodyTask> getInputType()
      Description copied from interface: DistributedTask
      Returns the expected input type class.

      Used for deserialization and type checking during task dispatch.

      Specified by:
      getInputType in interface DistributedTask<NBodyTask, NBodyTask>
      Returns:
      the Class object representing the input type
    • getOutputType

      public Class<NBodyTask> getOutputType()
      Description copied from interface: DistributedTask
      Returns the expected output type class.

      Used for serialization and type checking during result collection.

      Specified by:
      getOutputType in interface DistributedTask<NBodyTask, NBodyTask>
      Returns:
      the Class object representing the output type
    • execute

      public NBodyTask execute(NBodyTask input)
      Description copied from interface: DistributedTask
      Executes the computation for the given input chunk.

      This method contains the core scientific algorithm. It receives a chunk of input data and returns the computed result. The infrastructure handles serialization, network transfer, and result aggregation.

      Specified by:
      execute in interface DistributedTask<NBodyTask, NBodyTask>
      Parameters:
      input - the input data for this computation chunk
      Returns:
      the computed result
    • getTaskType

      public String getTaskType()
      Description copied from interface: DistributedTask
      Returns the unique task type identifier.

      This identifier is used by the task registry to locate and instantiate the appropriate task implementation. Examples: "MANDELBROT", "PROTEIN_FOLDING", "N_BODY", "CLIMATE_MODEL".

      Specified by:
      getTaskType in interface DistributedTask<NBodyTask, NBodyTask>
      Returns:
      the task type identifier (non-null, uppercase with underscores)
    • step

      public void step()
    • getBodies

      public List<NBodyTask.Body> getBodies()