Changeset - 00282418d2ef
[Not reviewed]
Merge default
0 1 0
ethanzonca - 15 years ago 2010-09-30 20:03:52

Merge
1 file changed with 12 insertions and 1 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -26,26 +26,28 @@ class Schedule
 
     * The input format of the sections. Only used for the UI. Valid
 
     * values are 'numerous' for custom, 'numbered' for numeric, and 'lettered' for
 
     * alphabetical.
 
     */
 
    public $section_format;
 

	
 
    /**
 
     * \brief
 
     *   Create a schedule with the given name.
 
     */
 
    function __construct($name)
 
    {
 
      $this->classStorage = array();
 
      $this->nclasses = 0;
 
      $this->scheduleName = $name;
 
      $this->storage = array();
 
      $this->title = "SlatePermutate - Scheduler";
 
      $this->section_format = 'numerous';
 
    }
 

	
 
	//--------------------------------------------------
 
	// Mutators and Accessors
 
	//--------------------------------------------------
 
	public function getName()
 
	{
 
		return $this->scheduleName;
 
	}    
 

	
 
@@ -84,25 +86,34 @@ class Schedule
 
        } else {
 
			$p = "unknown prof";
 
            $this->classStorage[$counter]->addSection($l, $p, $s, $e, $d);
 
        }
 
    }
 

	
 
	//--------------------------------------------------
 
	// Finds all of the possible permutations and stores
 
	// the results in the storage array.
 
	//--------------------------------------------------
 
	function findPossibilities()
 
	{
 
        $this->possiblePermutations = 1;
 
	  $this->possiblePermutations = 1;
 
	  /* special case: there is nothing entered into the schedule and thus there is one, NULL permutation */
 
	  if (!$this->nclasses)
 
	    {
 
	      /* have an empty schedule */
 
	      $this->classStorage[0] = array();
 
	      $this->nPermutations = 1;
 
	      return;
 
	    }
 

	
 
		$position = 0;
 
		$counter = 0;
 

	
 
        for($i = 0; $i < $this->nclasses; $i++)
 
        {
 
			$this->possiblePermutations = $this->possiblePermutations * $this->classStorage[$i]->getnsections();
 
			$cs[$i] = 0;	// Sets the counter array to all zeroes.
 
        }
 
        
 
		// Checks for conflicts in given classes, stores if none found
 
        do
 
        {
0 comments (0 inline, 0 general)