cs290b.project.tasks
Class MandelbrotTaskImpl

java.lang.Object
  extended by cs290b.project.api.Task
      extended by cs290b.project.tasks.MandelbrotTaskImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Task>

public class MandelbrotTaskImpl
extends Task
implements java.io.Serializable

Executes a divide and conquer version of the Mandelbrot set.

Author:
Chris Ferguson
See Also:
Serialized Form

Constructor Summary
MandelbrotTaskImpl(double startX, double startY, double width, int split, int max)
          Constructor accepting the arguements to create the set.
 
Method Summary
static double abs(double a, double bi)
           
 java.lang.Object execute(java.lang.Object input)
          Execute the task.
 int getMax()
           
 int getSplit()
           
 double getStartX()
           
 double getStartY()
           
 TaskId getTaskId()
          Return the associated TaskId
 double getWidth()
           
 java.lang.Object runMandelbrot()
          Executes the Mandelbrot set on the current values.
 void setTaskId(TaskId value)
          Assign the associated TaskId.
 
Methods inherited from class cs290b.project.api.Task
compareTo, compute, executeOnServer, getArgIndex, getChildTasks, getCriticalPath, getRunTime, getShared, getSourceServer, getSuccessorId, sendEvent, setArgIndex, setCriticalPath, setRunTime, setShared, setSourceServer, setSuccessorId, setSupport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MandelbrotTaskImpl

public MandelbrotTaskImpl(double startX,
                          double startY,
                          double width,
                          int split,
                          int max)
Constructor accepting the arguements to create the set.

Parameters:
startX - The lower left x-coordinate of the region.
startY - The lower left y-coordinate of the region.
width - The width of the square.
split - The number of times to split the square.
max - The number of iterations ("black" regions).
Method Detail

setTaskId

public void setTaskId(TaskId value)
Description copied from class: Task
Assign the associated TaskId.

Overrides:
setTaskId in class Task
Parameters:
value - The TaskId to set.

getTaskId

public TaskId getTaskId()
Description copied from class: Task
Return the associated TaskId

Overrides:
getTaskId in class Task
Returns:
The assigned TaskId.

getStartX

public double getStartX()

getStartY

public double getStartY()

getWidth

public double getWidth()

getSplit

public int getSplit()

getMax

public int getMax()

execute

public java.lang.Object execute(java.lang.Object input)
Execute the task. The input object defines the lower bound of the split. If below the lower bound, the task computes the values. Otherwise it splits the region into four equal sections.

Overrides:
execute in class Task
Parameters:
input - The shared input set by the client
Returns:
The computed result.

runMandelbrot

public java.lang.Object runMandelbrot()
Executes the Mandelbrot set on the current values.

Returns:
Two dimensional array of integers.

abs

public static double abs(double a,
                         double bi)


Anna Sibirtseva & Chris Ferguson, CS 290B