Spirograph Problem Set Javadocs

spirograph
Class BshAccel

java.lang.Object
  extended byspirograph.BshAccel
All Implemented Interfaces:
Accelerator

public class BshAccel
extends java.lang.Object
implements Accelerator

Implements and accelerator that uses bean shell to interpret student code. See www.beanshell.org for bean shell details.

Copyright © 1998 Massachusetts Institute of Technology.
Copyright © 2003 Franklin W. Olin College of Engineering.


Constructor Summary
BshAccel(java.lang.String fieldCode, java.lang.String bodyCode)
          Create a new Accelerator that uses the bean shell (bsh) interpreter to evaluate code, rather than the native Java compiler.
 
Method Summary
 double act(double pos, double vel, double otherPos, double otherVel, double maxPos)
          Calculate a new motion related value from position and velocity information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BshAccel

public BshAccel(java.lang.String fieldCode,
                java.lang.String bodyCode)
Create a new Accelerator that uses the bean shell (bsh) interpreter to evaluate code, rather than the native Java compiler.

Parameters:
fieldCode - The student code defining the fields (variables) used in the body code.
bodyCode - The student code to evaluate
Method Detail

act

public double act(double pos,
                  double vel,
                  double otherPos,
                  double otherVel,
                  double maxPos)
Description copied from interface: Accelerator
Calculate a new motion related value from position and velocity information. Usually this value represents, position, acceleration, or velocity.

Specified by:
act in interface Accelerator
Parameters:
pos - Current position on this axis
vel - Current velocity on this axis
otherPos - Current position on the other axis
otherVel - Current Velocity on the other axis
maxPos - The maximum position on this axis (+ or -)
Returns:
The new value

Spirograph Problem Set Javadocs