Class Schedule

java.lang.Object
  extended by Schedule

public class Schedule
extends Object

A schedule for the Psychology experiment application.

Version:
26 February 2006

Constructor Summary
Schedule()
          Construct a Schedule object.
 
Method Summary
 ArrayList<Session> createSessions()
          Generate all of the sessions necessary for the set of students in this schedule.
 void displaySessions(ArrayList<Session> sessions)
          Display a set of sessions.
 int numPeriods(int numExperimenters)
          Determine the number of periods necessary to have a given number of trained experimenters.
 int numSessions(int numStudents)
          Calculate the number of sessions needed for a given number of students.
 int numTrainers(int numPeriods)
          Calculate the number of trained experimenters available after a given amount of training periods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schedule

public Schedule()
Construct a Schedule object. Initializes attributes to default values.

Method Detail

numSessions

public int numSessions(int numStudents)
Calculate the number of sessions needed for a given number of students.

Parameters:
numStudents - the number of students
Returns:
the number of sessions

createSessions

public ArrayList<Session> createSessions()
Generate all of the sessions necessary for the set of students in this schedule.

Returns:
the set of sessions

displaySessions

public void displaySessions(ArrayList<Session> sessions)
Display a set of sessions.

Parameters:
sessions - the set of sessions to display

numTrainers

public int numTrainers(int numPeriods)
Calculate the number of trained experimenters available after a given amount of training periods. Assumptions: one initial trainer; training takes one period of a trainer and a trainee plus one period of the trainee on her/his own; once trained, an experimenter can train others.

Parameters:
numPeriods - the number of training periods
Returns:
the number of trained experimenters

numPeriods

public int numPeriods(int numExperimenters)
Determine the number of periods necessary to have a given number of trained experimenters. Uses same assumptions as the numTrainers method.

Parameters:
numExperimenters - the desired number of experimenters
Returns:
the nubmer of periods required