package csc263hw3starter;

import java.util.Random;

/*
 * 
 * Be sure to read README.txt before looking over this class.
 * 
 */
public class Experiment
{
    /**
     * The count1, count2, and count3 variables are suggested locatiosn to keep
     * the count of operations of interest in find1, find2, and find3 respectively.
     * 
     * Any code in the package csc263hw3starter can update these variables
     * with the following syntax (for N = 1,2,3) :
     * 
     *     Experiment.countN++;
     */
    public static int count1 = 0;
    public static int count2 = 0;
    public static int count3 = 0;
    
    public static void main(String[] args)
    {
        // You may find this class very helpful
        Random r = new Random();        
        
        // NOTE: 100 is simply an arbitrary default value.
        //       Feel free to change this value.
        int n = 100;
                
        // Here we have created 3 x n Set objects for you and stored references
        // to them in the arrays partition1, partition2, partition3.
        //
        // With respect to the text, this is the equivalent to
        //
        //    partition1[0] = makeSet(0)
        //    partition1[1] = makeSet(1)
        //    ...
        //    partition1[n-1] = makeSet(n-1)
        //
        // (and similarly for partion2, and partition3).
        //
        //
        // The suggested structure of an experiment your code is listed below:
        //
        // while there are more operations to perform :
        //     1. randomly choose an operation find (or union) to perform.
        //     2. randomly determine the element i (or elements i, j) to perform
        //        it on.
        //     3. for N = 1,2,3 :
        //            partitionN[i].findN()
        //            ( or partitionN[i].union(partition[j]) )
        //     
        // 
        // How many experiments you do, how many elements you have in your
        // partitions, the probability distributions over which you select
        // operations, how many total operations you perform, etc... is
        // entirely up to you. But be sure to justify your decisions in the
        // assignment writeup.
        //

        Set[] partition1 = new Set[n];
        for(int i = 0; i < n; ++i) partition1[i] = new Set(i);
        
        Set[] partition2 = new Set[n];
        for(int i = 0; i < n; ++i) partition2[i] = new Set(i);
        
        Set[] partition3 = new Set[n];
        for(int i = 0; i < n; ++i) partition3[i] = new Set(i);  
        
        // perform your experiments below
        
    }
}
