def main():
    """ Runs independently from command line to test the GAssist algorithm. """
    graphPerformance = False # Built in graphing ability, currently not functional, but mechanism is in place.
    trainData = "2_1000_0_1600_0_0_CV_0_Train.txt"
    testData = "2_1000_0_1600_0_0_CV_0_Test.txt"
    outProg = "GH_GAssist_ProgressTrack"
    outPop = "GH_GAssist_PopulationOut"
    bitLength = 1    # This implementation is not yet set up to handle other rule representations, or bit encoding lengths.
    CVpartitions = 10
    trackCycles = 1
    
    # Run Parameters - User specified.
    iterInput = '20.50.100' 
    pop = 100
    wild = 0.5
    defaultClass = "0"  #auto, 0, disabled   
    init = "cw"  #'none', 'smart', 'cw'
    MDL = 1
    windows = 2
    
    #Figure out the iteration stops for evaluation, and the max iterations.
    iterList = iterInput.split('.')
    for i in range(len(iterList)):
        iterList[i] = int(iterList[i])
    lastIter = iterList[len(iterList)-1]  

    #Sets up up algorithm to be run.
    e = GAssist_Environment(trainData,testData,bitLength, init) 
    cons.setConstants(pop, wild, defaultClass, e, MDL, windows) 
    sampleSize = e.getNrSamples()
    gassist = GAssist(e, outProg, outPop, bitLength, CVpartitions, graphPerformance) 
    
    #Set some GAssist parameters.
    if trackCycles == 'Default':
        gassist.setTrackingIterations(sampleSize)
    else:
        gassist.setTrackingIterations(trackCycles) 
    gassist.setNumberOfTrials(lastIter, iterList)  
    gassist.setInitialization(init)
    #Run the GAssist Algorithm 
    gassist.runGAssist()
    12: Wild frequency - 0.5, 0.75
    13: Default Class Handeling - auto, 0, disabled  - automatic default class evolution, vs. pre-specify the default class (can also add a method which chooses via which class is most represented.
    14: MDL fitness - '0', '1' - where 0 is False, and 1 is True.
    15: Windows - '1', '2', '4' - number of partitions of the dataset used in the learning process. (higher values tend to promote generalization, and reduce computational time.)
"""
# *************************************************************************************************

graphPerformance = False # Built in graphing ability, currently not functional, but mechanism is in place. NOT MEANT TO BE USED ON CLUSTER.
numArgs = len(argv)
print "Arguments: " + str(numArgs)
if numArgs == 16:
    if argv[1] == 'gh': #Different rule representations could be programmed but have not been in this implementation.
        print ("Format Training data: "+argv[2]+"  using a "+argv[6]+" bit coding scheme.")
        
        #Sets up up algorithm to be run.
        e = GAssist_Environment(str(argv[2]), str(argv[3]), int(argv[6]), str(argv[10]))
        cons.setConstants(int(argv[11]), float(argv[12]), str(argv[13]), e, str(argv[14]), str(argv[15])) 
        sampleSize = e.getNrSamples()
        gassist = GAssist(e, argv[4], argv[5], int(argv[6]), int(argv[7]), graphPerformance)
        
        #Figure out the iteration stops for evaluation, and the max iterations.
        iterList = argv[9].split('.')
        for i in range(len(iterList)):
            iterList[i] = int(iterList[i])
        lastIter = iterList[len(iterList)-1]
        
        #Set some GAssist parameters.
        if argv[9] == 'Default':
            gassist.setTrackingIterations(sampleSize)
        else:
            gassist.setTrackingIterations(int(argv[8]))