// Path: src/org/drugepi/match/Match.java
// public enum MatchType {
// 	NEAREST_NEIGHBOR, NN, BALANCED_NEAREST_NEIGHBOR, BALANCED_NN, 
// 	GREEDY_DIGIT, GREEDY_CALIPER, GREEDY, COMPLETE ;
// 		
// 	public static MatchType toMatchType(String s) {
// 		if (s == null) 
// 			return null;
// 			
// 		try {
// 			return(valueOf(s.toUpperCase()));
// 		} catch (Exception e) {
// 			return null;
// 		}
// 	}
// }


import org.drugepi.match.*;
import org.drugepi.match.Match.MatchType;
import org.drugepi.match.storage.*;
import java.util.*;
	public void assignMatchGroups()
	{
    	// set the treatment group to be the first-specified group
    	this.treatmentGroup = this.matchGroupsList.get(0);

	  	// set the referent group to be the second-specified group
    	this.referentGroup = this.matchGroupsList.get(1);

		this.treatmentGroupSize = treatmentGroup.size();
		this.referentGroupSize = referentGroup.size();
	}
	
	public void printPreMatchStatistics() 
	{
	  	System.out.printf("%d:1 match beginning using the %s match method in %s ratio, %s mode\n", 
	  			this.match.matchRatio, this.getClass().getSimpleName(),
	  			(this.match.fixedRatio == 0 ? "variable" : "fixed"),
	  			(this.match.parallelMatchingMode == 0 ? "sequential" : "parallel"));
	    
       	System.out.printf("%d items in the treatment (indicator=%s) group\n", this.treatmentGroup.size(), treatmentGroup.groupIndicator);
    	System.out.printf("%d items in the referent (indicator=%s) group\n", this.referentGroup.size(), referentGroup.groupIndicator);
	}
	
	public void printPostMatchStatistics() 
	{
		int[] matchedSetsPerLevel = new int[this.match.matchRatio + 1];
		int numRefPatientsMatched = 0;
		int numTreatmentPatientsMatched = 0;
		double totalMatchDistance = 0;

// Path: src/org/drugepi/match/Match.java
// public enum MatchType {
// 	NEAREST_NEIGHBOR, NN, BALANCED_NEAREST_NEIGHBOR, BALANCED_NN, 
// 	GREEDY_DIGIT, GREEDY_CALIPER, GREEDY, COMPLETE ;
// 		
// 	public static MatchType toMatchType(String s) {
// 		if (s == null) 
// 			return null;
// 			
// 		try {
// 			return(valueOf(s.toUpperCase()));
// 		} catch (Exception e) {
// 			return null;
// 		}
// 	}
// }


// Path: src/org/drugepi/match/controllers/TwoWayMatchController.java
import org.drugepi.match.*;
import org.drugepi.match.Match.MatchType;
import org.drugepi.match.storage.*;
import java.util.*;

	public void assignMatchGroups()
	{
    	// set the treatment group to be the first-specified group
    	this.treatmentGroup = this.matchGroupsList.get(0);

	  	// set the referent group to be the second-specified group
    	this.referentGroup = this.matchGroupsList.get(1);

		this.treatmentGroupSize = treatmentGroup.size();
		this.referentGroupSize = referentGroup.size();
	}
	
	public void printPreMatchStatistics() 
	{
	  	System.out.printf("%d:1 match beginning using the %s match method in %s ratio, %s mode\n", 
	  			this.match.matchRatio, this.getClass().getSimpleName(),
	  			(this.match.fixedRatio == 0 ? "variable" : "fixed"),
	  			(this.match.parallelMatchingMode == 0 ? "sequential" : "parallel"));
	    
       	System.out.printf("%d items in the treatment (indicator=%s) group\n", this.treatmentGroup.size(), treatmentGroup.groupIndicator);
    	System.out.printf("%d items in the referent (indicator=%s) group\n", this.referentGroup.size(), referentGroup.groupIndicator);
	}
	
	public void printPostMatchStatistics() 
	{
		int[] matchedSetsPerLevel = new int[this.match.matchRatio + 1];
		int numRefPatientsMatched = 0;
		int numTreatmentPatientsMatched = 0;
		double totalMatchDistance = 0;

		if (this.match.getMatchType() == MatchType.COMPLETE) {