edu.wpi.prc.templates.java.science
Class ScienceDataProcessor

java.lang.Object
  extended by edu.wpi.prc.templates.java.science.ScienceDataProcessor

public class ScienceDataProcessor
extends java.lang.Object

The ScienceDataProcessor contains all of the project-specific methods required to compute the results for work units. This class is used by the ComputeThread.

Author:
James Baldassari

Field Summary
private  byte[] workUnitData
           
 
Constructor Summary
ScienceDataProcessor(byte[] workUnitData)
          Constructor that takes a byte array representing the work unit data to be processed.
 
Method Summary
 byte[] computeResult()
          This method checks for previously saved checkpoints, then runs the science algorithm.
private  void scienceAlgorithm()
          This is the science algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workUnitData

private byte[] workUnitData
Constructor Detail

ScienceDataProcessor

public ScienceDataProcessor(byte[] workUnitData)
Constructor that takes a byte array representing the work unit data to be processed.

Parameters:
workUnitData - The work unit data.
Method Detail

computeResult

public byte[] computeResult()
This method checks for previously saved checkpoints, then runs the science algorithm. It then converts the result into a byte array, which will be returned to the server.

Returns:
Returns a byte array representing the computed result.

scienceAlgorithm

private void scienceAlgorithm()
This is the science algorithm.