package execution;

import sample.Examples;
import sample.ExamplesInputs;
import FMM.*;

import algorithms.MaintenanceAlgorithms;
import algorithms.XMLutility;

import com.thoughtworks.xstream.XStream;



public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{

		///////////////////////////////////////extension Example 1
		//PF pf = Examples.extensionEx1();
		//String path = "C:\\Path\\extEx1\\extensionEx1output.xml";
		
		///////////////////////////////////////extension Example 2
		PF pf = Examples.extensionEx2();
		String path = "C:\\Path\\extEx2\\extensionEx2output.xml";
	
		///////////////////////////////////////elimination Example 1
		//elimination Example 1 complimentary XML creator. (need to be run just once in order to create XML file for obsolete pattern) 
		//ExamplesInputs.eliminationEx1In2CreateXML(); 
		
		//PF pf = Examples.eliminationEx1();
		//String path = "C:\\Path\\elmEx1\\eliminationEx1output.xml";

			
		//////////////////////////////////////////////////Combination Example 1
		
		////////////////////////////////////////////combination Example 1 complimentary XML creators. (need to be run just once in order to create XML file for obsolete pattern) 
		//ExamplesInputs.combincationEx1In1CreateXML();
		//ExamplesInputs.combincationEx1In2CreateXML();			
		
		//PF pf = Examples.combinationEx1();
		//String path = "C:\\Path\\cmbEx1\\combinationEx1output.xml";


		
		////////////////////////////////////////////Initialize XStream
		XStream xstream =  new XStream();

		////////////////////////////////////////////Enable no_reference mode to prevent using reference tag in the output (reverse engineering would be difficult)
		//xstream.setMode(XStream.NO_REFERENCES);
		
		////////////////////////////////////////////Simplify pf by removing ElementLinks
		//for (Pattern p:pf.patternCollection())
		//	p.GT.links = null;
		
		
		
		////////////////////////////////////////////Use the following to export to file
		XMLutility.serializePFtoXMLfile(pf, xstream, path);
		
		////////////////////////////////////////////Alternatively this can be used for printing the output on the screen
		//System.out.println(xstream.toXML(pf)); 		
		
	}


}
