[snee] r1384 committed - commit to allow me to do robust testing at home

1 view
Skip to first unread message

sn...@googlecode.com

unread,
Oct 18, 2013, 12:27:32 PM10/18/13
to snee-...@googlegroups.com
Revision: 1384
Author: alan.bar...@gmail.com
Date: Fri Oct 18 16:26:33 2013 UTC
Log: commit to allow me to do robust testing at home
http://code.google.com/p/snee/source/detail?r=1384

Added:

/branches/alan_2012_07_19_unreliableChannels/clients/client/src/main/java/uk/ac/manchester/cs/snee/client/SampleClient.java

/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/java/uk/ac/manchester/snee/client/tupleDataPlot.java

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/CollateForEnergyTime.java

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/adaptationStore.java

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/QUERIESgENERATED

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Attribute.java

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Query.java

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/TPCH.java

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Table.java

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Window.java

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/resources/testsSize100/QUERIESgENERATED
Modified:

/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/java/uk/ac/manchester/snee/client/SNEEFailedNodeEvalClientUsingInNetworkSource.java

/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/resources/etc/query-parameters.xml

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/SNEEFailedNodeEvalClientUsingInNetworkSourceTimeDelay.java

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query1.xml

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query2.xml

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query62.xml

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize30/logicalSchema_query2.xml

/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize30/logicalSchema_query60.xml

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/autoPlotter/PlotFolderGenerators.java

/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/resources/testsSize100/logicalSchema_query2.xml

/branches/alan_2012_07_19_unreliableChannels/snee-wsn-manager/src/main/java/uk/ac/manchester/cs/snee/manager/planner/costbenifitmodel/ChoiceAssessor.java

=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/client/src/main/java/uk/ac/manchester/cs/snee/client/SampleClient.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,370 @@
+package uk.ac.manchester.cs.snee.client;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Observable;
+import java.util.Observer;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+
+import uk.ac.manchester.cs.snee.EvaluatorException;
+import uk.ac.manchester.cs.snee.MetadataException;
+import uk.ac.manchester.cs.snee.ResultStoreImpl;
+import uk.ac.manchester.cs.snee.SNEECompilerException;
+import uk.ac.manchester.cs.snee.SNEEController;
+import uk.ac.manchester.cs.snee.SNEEDataSourceException;
+import uk.ac.manchester.cs.snee.SNEEException;
+import uk.ac.manchester.cs.snee.common.SNEEConfigurationException;
+import uk.ac.manchester.cs.snee.compiler.AgendaException;
+import uk.ac.manchester.cs.snee.compiler.AgendaLengthException;
+import uk.ac.manchester.cs.snee.compiler.OptimizationException;
+import uk.ac.manchester.cs.snee.compiler.WhenSchedulerException;
+import uk.ac.manchester.cs.snee.compiler.queryplan.expressions.Attribute;
+import uk.ac.manchester.cs.snee.metadata.schema.AttributeType;
+import uk.ac.manchester.cs.snee.metadata.schema.ExtentMetadata;
+import uk.ac.manchester.cs.snee.metadata.schema.SchemaMetadataException;
+import uk.ac.manchester.cs.snee.metadata.schema.TypeMappingException;
+import uk.ac.manchester.cs.snee.sncb.CodeGenerationException;
+
+public class SampleClient implements Observer {
+
+ private static Logger logger =
+ Logger.getLogger(SampleClient.class.getName());
+
+ private SNEEController controller;
+ protected String _propertiesFile;
+ protected String _query = null;
+ protected double _duration;
+ protected String _queryParams = null;
+ private String _csvFilename = null;
+
+ private boolean firstTime = true;
+ private boolean keepOn = true;
+ public boolean displayResultsAtEnd = false;
+
+ /**
+ * Configures the SNEE query engine according to the properties
+ * specified in the properties file.
+ *
+ * @param propertiesFile location of the snee configuration file
+ * @throws SNEEException
+ * @throws IOException
+ * @throws SNEEConfigurationException
+ * @throws MetadataException
+ * @throws SNEEDataSourceException
+ */
+ public SampleClient(String propertiesFile, String query, double duration,
+ String queryParameters, String csvFilename)
+ throws SNEEException, IOException, SNEEConfigurationException,
+ MetadataException, SNEEDataSourceException
+ {
+ if (logger.isDebugEnabled())
+ logger.debug("ENTER SampleClient()");
+ controller = new SNEEController(propertiesFile);
+ this._propertiesFile = propertiesFile;
+ this._query = query;
+ this._duration = duration;
+ this._queryParams = queryParameters;
+ this._csvFilename = csvFilename;
+ if (logger.isDebugEnabled())
+ logger.debug("RETURN");
+ }
+
+ /**
+ * Displays the extents available for querying
+ */
+ public void displayExtents()
+ throws MetadataException
+ {
+ Collection<String> extents = controller.getExtentNames();
+ for (String extent : extents) {
+ displayExtentSchema(extent);
+ }
+ }
+
+ private void displayExtentSchema(String extentName)
+ throws MetadataException
+ {
+ ExtentMetadata extent =
+ controller.getExtentDetails(extentName);
+ List<Attribute> attributes = extent.getAttributes();
+ System.out.println("Attributes for " + extentName + ":");
+ for (Attribute attr : attributes) {
+ String attrName = attr.getAttributeDisplayName();
+ AttributeType attrType = attr.getType();
+ System.out.print("\t" + attrName + ": " +
+ attrType.getName() + "\n");
+ }
+ System.out.println();
+ }
+
+ private void printRow(ResultSet rs, ResultSetMetaData metaData,
+ int numCols, String sep, PrintStream out) throws SQLException {
+ StringBuffer buffer = new StringBuffer();
+
+ java.util.Date date= new java.util.Date();
+ String time = new Timestamp(date.getTime()).toString();
+ buffer.append(time);
+ buffer.append(sep);
+
+ for (int i = 1; i <= numCols; i++) {
+ Object value = rs.getObject(i);
+ if (metaData.getColumnType(i) ==
+ Types.TIMESTAMP && value instanceof Long) {
+ buffer.append(
+ new Date(((Long) value).longValue()));
+ } else {
+ buffer.append(value);
+ }
+ buffer.append(sep);
+ }
+ out.println(buffer.toString());
+ }
+
+ private void printResults(List<ResultSet> results,
+ int queryId, String csvFilename)
+ throws SQLException, FileNotFoundException {
+ PrintStream out = null;
+ if (csvFilename != null)
+ out = new PrintStream(new FileOutputStream(csvFilename, true));
+
+ System.out.println("************ Results for query " +
+ queryId + " ************");
+ for (ResultSet rs : results) {
+ ResultSetMetaData metaData = rs.getMetaData();
+ int numCols = metaData.getColumnCount();
+ if (firstTime && csvFilename != null) {
+ printColumnHeadings(metaData, numCols, ",", out);
+ firstTime = false;
+ }
+
+ printColumnHeadings(metaData, numCols, "\t", System.out);
+ while (rs.next()) {
+ printRow(rs, metaData, numCols, "\t", System.out);
+ if (csvFilename != null)
+ printRow(rs, metaData, numCols, ",", out);
+ }
+ }
+ System.out.println("*********************************");
+ }
+
+ private void printColumnHeadings(ResultSetMetaData metaData,
+ int numCols, String sep, PrintStream out) throws SQLException {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("deliver_time");
+ buffer.append(sep);
+ for (int i = 1; i <= numCols; i++) {
+ buffer.append(metaData.getColumnLabel(i));
+// buffer.append(":" + metaData.getColumnTypeName(i));
+ buffer.append(sep);
+ }
+ out.println(buffer.toString());
+ }
+
+
+ public void update (Observable observation, Object arg) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("ENTER update() with " + observation + " " +
+ arg);
+ }
+ if (arg instanceof List<?>) {
+ List<ResultSet> results = (List<ResultSet>) arg;
+ try {
+ printResults(results, 1, _csvFilename);
+ } catch (SQLException e) {
+ logger.error("Problem printing result set. ", e);
+ } catch (FileNotFoundException e) {
+ logger.error("Problem writing results to csv file. ", e);
+ }
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("RETURN update()");
+ }
+ }
+
+
+ /**
+ * Execute a SNEEql query using the configured SNEE query execution
+ * engine.
+ *
+ * @param query SNEEql query string to be executed
+ * @param duration length in seconds to execute the query
+ * @param queryParams location of the parameters file associated with the
query
+ * @throws AgendaLengthException
+ * @throws AgendaException
+ * @throws WhenSchedulerException
+ * @throws CodeGenerationException
+ * @throws IOException
+ * @throws OptimizationException
+ * @throws TypeMappingException
+ * @throws SchemaMetadataException
+ * @throws NumberFormatException
+ */
+ public void executeQuery()
+ throws SNEECompilerException, MetadataException, EvaluatorException,
+ SNEEException, SQLException, SNEEConfigurationException,
+ NumberFormatException, SchemaMetadataException, TypeMappingException,
+ OptimizationException, IOException, CodeGenerationException,
+ WhenSchedulerException, AgendaException, AgendaLengthException {
+ if (logger.isDebugEnabled())
+ logger.debug("ENTER executeQuery() with query " + _query +
+ " parameters " + _queryParams +
+ " duration " + _duration);
+
+ System.out.println("Query: " + this._query);
+
+ int queryId1 = controller.addQuery(_query, _queryParams);
+
+ long startTime = System.currentTimeMillis();
+ ResultStoreImpl resultStore =
+ (ResultStoreImpl) controller.getResultStore(queryId1);
+ resultStore.addObserver(this);
+
+ Runtime.getRuntime().addShutdownHook(new RunWhenShuttingDown(queryId1,
+ resultStore));
+ if (_duration == Double.POSITIVE_INFINITY) {
+ runQueryIndefinitely();
+ } else {
+ runQueryForFixedPeriod(startTime);
+ }
+ displayResultsAtEnd = true;
+
+ if (logger.isDebugEnabled())
+ logger.debug("RETURN executeQuery()");
+ }
+
+ private void runQueryIndefinitely() throws SNEEException {
+ System.out.println("Running query indefinitely. Press CTRL+C to exit.");
+
+ while (keepOn) {
+ try {
+ Thread.currentThread().sleep(10000);
+ } catch (InterruptedException e) {
+ }
+ Thread.currentThread().yield();
+ }
+ }
+
+ private void runQueryForFixedPeriod(long startTime)
+ throws SNEEException {
+ long endTime = (long) (startTime + (_duration * 1000));
+ System.out.println("Running query for " + _duration + " seconds.
Scheduled end time " + new Date(endTime));
+
+ try {
+ Thread.currentThread().sleep((long)_duration * 1000);
+ } catch (InterruptedException e) {
+ }
+
+ while (System.currentTimeMillis() < endTime) {
+ Thread.currentThread().yield();
+ }
+ }
+
+ public class RunWhenShuttingDown extends Thread {
+ private int _queryId;
+ private ResultStoreImpl _resultStore;
+
+ public RunWhenShuttingDown(int queryId, ResultStoreImpl
resultStore) {
+ _queryId = queryId;
+ _resultStore = resultStore;
+ }
+
+ public void run() {
+ keepOn = false;
+ System.out.println("Stopping query " + _queryId + ".");
+ try {
+ List<ResultSet> results1 = _resultStore.getResults();
+ controller.removeQuery(_queryId);
+
+ //XXX: Sleep included to highlight evaluator not ending bug
+ //Thread.currentThread().sleep((long) ((_duration/2) * 1000));
+ Thread.sleep(2000);
+
+ controller.close();
+ if (displayResultsAtEnd)
+ printResults(results1, _queryId, null);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SNEEException e1) {
+ e1.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * The main entry point for the Sample Client
+ * @param args
+ * @throws IOException
+ * @throws InterruptedException
+ */
+ public static void main(String[] args) {
+ String propertiesFile = null;
+ String query = null;
+ Double duration = null;
+ String params = null;
+ String csvFile = null;
+
+ // Configure logging
+ PropertyConfigurator.configure(
+ SampleClient.class.getClassLoader().
+ getResource("etc/log4j.properties"));
+ //This method represents the web server wrapper
+ if (args.length != 5) {
+ System.out.println("Usage: \n" +
+ "\t\"location of SNEE properties file\"\n" +
+ "\t\"query statement\"\n" +
+ "\t\"query duration in seconds, or 'ind' for indefinite\"\n" +
+ "\t\"location of query parameters file, or null\"" +
+ "\t\"csv file to log results, or null\"\n");
+ System.exit(1);
+ } else {
+ propertiesFile = args[0];
+ query = args[1];
+ if (args[2].equalsIgnoreCase("inf") || args[2].equalsIgnoreCase("ind"))
{
+ duration = Double.POSITIVE_INFINITY;
+ } else {
+ duration = Double.valueOf(args[2]);
+ }
+ if (!(args[3].equalsIgnoreCase("null"))) {
+ params = args[3];
+ }
+ if (!(args[4].equalsIgnoreCase("null"))) {
+ csvFile = args[4];
+ }
+ }
+
+ try {
+ /* Initialise the Client */
+ SampleClient client =
+ new SampleClient(propertiesFile, query, duration, params, csvFile);
+ /* Print the available extents */
+ client.displayExtents();
+ /* Execute the query */
+ client.executeQuery();
+ } catch (Exception e) {
+ System.out.println("Execution failed. See logs for detail.");
+ logger.fatal(e);
+ System.exit(1);
+ }
+
+ System.out.println("Success!");
+ System.exit(0);
+ }
+
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/java/uk/ac/manchester/snee/client/tupleDataPlot.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,55 @@
+package uk.ac.manchester.snee.client;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class tupleDataPlot
+{
+ public static void main (String [] args)
+ {
+ try
+ {
+ BufferedReader in = new BufferedReader(new FileReader(new
File("/mnt/usb/1st1/severalNodeFailure/lifetime_results/largetopologysetseveralNodeFailureQOS2finalResults")));
+ BufferedReader inBuff = new BufferedReader(new FileReader(new
File("/mnt/usb/1st1/severalNodeFailure/tuples/large2/buff2")));
+ BufferedWriter out = new BufferedWriter(new FileWriter(new
File("/mnt/usb/1st1/severalNodeFailure/tuples/large2/data")));
+
+ String inLine = "";
+ while((inLine = in.readLine()) != null)
+ {
+ Integer inBuffLine = Integer.parseInt(inBuff.readLine());
+ String [] bits = inLine.split(" ");
+ int index = 1;
+ String outLine = bits[0] + " ";
+ while(index < bits.length)
+ {
+ Double tuples = Double.parseDouble(bits[index]) * inBuffLine;
+ outLine = outLine.concat(tuples.toString() + " ");
+ index++;
+ }
+ out.write(outLine + "\n");
+ }
+ out.flush();
+ out.close();
+ in.close();
+ inBuff.close();
+
+ }
+ catch (FileNotFoundException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/CollateForEnergyTime.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,234 @@
+package uk.ac.manchester.snee.client;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+public class CollateForEnergyTime
+{
+ private static File inputFolder = new
File("/mnt/usb/1st1/severalNodeFailure/largetopologysetseveralNodeFailureQoSset2final");
+ private static File outputFolder = new
File("/mnt/usb/1st1/severalNodeFailure/largetopologysetseveralNodeFailureQoSset2finalResultsTEL");
+ private static HashMap<String, adaptationStore> gData = new
HashMap<String, adaptationStore>();
+ private static HashMap<String, adaptationStore> pData = new
HashMap<String, adaptationStore>();
+ private static String sep = System.getProperty("file.separator");
+ private static ArrayList<Integer> gPoints = new ArrayList<Integer>();
+ private static ArrayList<Integer> pPoints = new ArrayList<Integer>();
+
+
+ public static void main(String [] args)
+ {
+ try
+ {
+ File[] queriesInFolder = inputFolder.listFiles();
+ gPoints.addAll(Arrays.asList(1,3,6,10,15,21,28,36));
+ pPoints.addAll(Arrays.asList(37, 39, 42, 46, 51, 57, 64, 72));
+
+ for(int folderIndex =0; folderIndex < queriesInFolder.length;
folderIndex++)
+ {
+ File queryFolder = queriesInFolder[folderIndex];
+ if(queryFolder.isDirectory())
+ {
+ System.out.println("processing query " + queryFolder.getName());
+ File autonomicFolder = new
File(queryFolder.toString()+sep+"output"+sep+queryFolder.getName()+sep+"AutonomicManData");
+ File[] adaptations = autonomicFolder.listFiles();
+ if(adaptations != null)
+ {
+ for(int AdaptationIndex =0; AdaptationIndex <
adaptations.length; AdaptationIndex++)
+ {
+ File adaptationFolder = adaptations[AdaptationIndex];
+ if(adaptationFolder.getName().split("Adapt").length != 1)
+ {
+ Integer adaptationID =
Integer.parseInt(adaptationFolder.getName().split("Adaption")[1]);
+ if(adaptationID < 37)
+ {
+ if(gPoints.contains(adaptationID))
+ {
+ System.out.println("adding data for G at query " +
queryFolder.getName() + " for adaptation " + adaptationID);
+ adaptationStore store =
gData.get(queryFolder.getName());
+ if(store == null)
+ store = new adaptationStore();
+ addData(store, adaptationID, adaptationFolder,
gPoints, queryFolder, gData);
+ }
+ }
+ else
+ {
+ if(pPoints.contains(adaptationID))
+ {
+ System.out.println("adding data for P at query " +
queryFolder.getName() + " for adaptation " + adaptationID);
+ adaptationStore store =
pData.get(queryFolder.getName());
+ if(store == null)
+ store = new adaptationStore();
+ addData(store, adaptationID, adaptationFolder,
pPoints, queryFolder, pData);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ outputData();
+ }
+ catch (FileNotFoundException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+
+ private static void outputData() throws IOException
+ {
+ if(!outputFolder.exists())
+ outputFolder.mkdir();
+
+ BufferedWriter outE = new BufferedWriter(new
FileWriter(outputFolder.toString() + sep + "energy"));
+ BufferedWriter outL = new BufferedWriter(new
FileWriter(outputFolder.toString() + sep + "life"));
+ BufferedWriter outT = new BufferedWriter(new
FileWriter(outputFolder.toString() + sep + "time"));
+
+ Iterator<String> queryKeysIterator = sort(gData.keySet()).iterator();
+ while(queryKeysIterator.hasNext())
+ {
+ String queryID = queryKeysIterator.next();
+ String outputE = queryID + " ";
+ String outputL = queryID + " ";
+ String outputT = queryID + " ";
+ adaptationStore gStore = gData.get(queryID);
+ adaptationStore pStore = pData.get(queryID);
+ Iterator<Double> gEnergyIterator = gStore.getEnergyCost().iterator();
+ Iterator<Double> pEnergyIterator = pStore.getEnergyCost().iterator();
+ Iterator<Double> gTimeIterator = gStore.getTimeCost().iterator();
+ Iterator<Double> pTimeIterator = pStore.getTimeCost().iterator();
+ Iterator<Double> gLifeIterator = gStore.getLifetime().iterator();
+ Iterator<Double> pLifeIterator = pStore.getLifetime().iterator();
+
+ Double energy = 0.0;
+ while(gEnergyIterator.hasNext())
+ {
+ Double energyT = gEnergyIterator.next();
+ if(energyT != null)
+ energy += energyT;
+ outputE = outputE.concat(energy.toString() + " ");
+ }
+ energy = 0.0;
+ while(pEnergyIterator.hasNext())
+ {
+ Double energyT = pEnergyIterator.next();
+ if(energyT != null)
+ energy +=energyT;
+ outputE = outputE.concat(energy.toString() + " ");
+ }
+ outE.write(outputE + "\n");
+
+ Double time = 0.0;
+ while(gTimeIterator.hasNext())
+ {
+ Double energyT = gTimeIterator.next();
+ if(energyT != null)
+ time += energyT;
+ outputT = outputT.concat(time.toString() + " ");
+ }
+ time = 0.0;
+ while(pTimeIterator.hasNext())
+ {
+ Double energyT = pTimeIterator.next();
+ if(energyT != null)
+ time += energyT;
+ outputT = outputT.concat(time.toString() + " ");
+ }
+ outT.write(outputT + "\n");
+
+ while(gLifeIterator.hasNext())
+ {
+ Double energyT = gLifeIterator.next();
+ if(energyT != null)
+ {
+ Double life = energyT;
+ outputL = outputL.concat(life.toString() + " ");
+ }
+ }
+ while(pLifeIterator.hasNext())
+ {
+ Double energyT = pLifeIterator.next();
+ if(energyT != null)
+ {
+ Double life = energyT;
+ outputL = outputL.concat(life.toString() + " ");
+ }
+ }
+
+ outL.write(outputL + "\n");
+ }
+
+ outE.flush();
+ outE.close();
+ outL.flush();
+ outL.close();
+ outT.flush();
+ outT.close();
+ }
+
+
+ private static void addData(adaptationStore store, Integer adaptationID,
+ File adaptationFolder, ArrayList<Integer>
points,
+ File queryFolder, HashMap<String,
adaptationStore> data)
+ throws IOException
+ {
+ File dataFile = new File(adaptationFolder.toString() + sep +
+ "Planner" + sep + "assessment" +sep +
+ "Adaptations" + sep + "adaptList");
+ if(dataFile.exists())
+ {
+ BufferedReader in = new BufferedReader(new FileReader(dataFile));
+ String line = in.readLine();
+ String [] dataBits = line.split("Cost");
+ dataBits[1]= dataBits[1].replace("[", "");
+ dataBits[1]= dataBits[1].split("j")[0].split(" ")[1];
+ dataBits[2]= dataBits[2].replace("[", "");
+ dataBits[2]= dataBits[2].split("ms")[0].split(" ")[1];
+ dataBits[3]= dataBits[3].split("Estimate")[1].split("
ms")[0].split(" ")[1].replace("[", "");
+ store.setEnergy(points.indexOf(adaptationID),
+ Double.parseDouble(dataBits[1]));
+ store.setTime(points.indexOf(adaptationID),
+ Double.parseDouble(dataBits[2])/1000);
+ store.setLife(points.indexOf(adaptationID),
+ Double.parseDouble(dataBits[3]));
+ data.put(queryFolder.getName(), store);
+ in.close();
+ }
+ }
+
+ private static ArrayList<String> sort(Set<String> list)
+ {
+ ArrayList<String> sorted = new ArrayList<String>();
+ for(int index = 0; index < 90; index++)
+ {
+ sorted.add(null);
+ }
+ Iterator<String> keys = list.iterator();
+ while(keys.hasNext())
+ {
+ String possibleAdpatationfolder = keys.next();
+ String [] bits = possibleAdpatationfolder.split("query");
+ sorted.set(Integer.parseInt(bits[1]), possibleAdpatationfolder);
+ }
+ for(int index = 0; index < 90; index++)
+ {
+ sorted.remove(null);
+ }
+ return sorted;
+ }
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/adaptationStore.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,73 @@
+package uk.ac.manchester.snee.client;
+
+import java.util.ArrayList;
+
+public class adaptationStore
+{
+ private ArrayList<Double> energyCost = new ArrayList<Double>();
+ private ArrayList<Double> timeCost = new ArrayList<Double>();
+ private ArrayList<Double> lifetime = new ArrayList<Double>();
+
+ public adaptationStore(ArrayList<Double> energy, ArrayList<Double> time,
ArrayList<Double> life)
+ {
+ this.setEnergyCost(energy);
+ this.setTimeCost(time);
+ this.setLifetime(life);
+ }
+
+ public adaptationStore()
+ {
+ for(int index = 0; index<8; index++)
+ {
+ energyCost.add(null);
+ timeCost.add(null);
+ lifetime.add(null);
+ }
+ }
+
+ public Double setEnergy(int index, Double element)
+ {
+ return energyCost.set(index, element);
+ }
+
+ public Double setTime(int index, Double element)
+ {
+ return this.timeCost.set(index, element);
+ }
+
+ public Double setLife(int index, Double element)
+ {
+ return this.lifetime.set(index, element);
+ }
+
+ public void setEnergyCost(ArrayList<Double> energyCost)
+ {
+ this.energyCost = energyCost;
+ }
+
+ public ArrayList<Double> getEnergyCost()
+ {
+ return energyCost;
+ }
+
+ public void setTimeCost(ArrayList<Double> timeCost)
+ {
+ this.timeCost = timeCost;
+ }
+
+ public ArrayList<Double> getTimeCost()
+ {
+ return timeCost;
+ }
+
+ public void setLifetime(ArrayList<Double> lifetime)
+ {
+ this.lifetime = lifetime;
+ }
+
+ public ArrayList<Double> getLifetime()
+ {
+ return lifetime;
+ }
+
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/QUERIESgENERATED
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,34 @@
+SELECT anow.z, bnow.x, bnow.y, bnow.z, bnow.a FROM A[range 10 SECONDS
slide 20 SECONDS] anow, B[now] bnow WHERE bnow.y = anow.x AND anow.y>157
AND bnow.z<53;
+SELECT bnow.*, anow.* FROM B[now] bnow , A[now] anow WHERE anow.x = bnow.y
AND bnow.y>856 AND bnow.a<56 AND anow.y<705 AND anow.b<700 AND anow.b<546
AND anow.b<194;
+SELECT bnow.*, anow.x FROM B[now] bnow, A[range 10 SECONDS slide 10
SECONDS] anow WHERE anow.x = bnow.y AND anow.y>736;
+SELECT bnow.a, anow.* FROM B[range 10 SECONDS slide 50 SECONDS] bnow,
A[range 40 SECONDS slide 50 SECONDS] anow WHERE anow.x = bnow.y;
+SELECT bnow.*, anow.* FROM B[range 10 SECONDS slide 90 SECONDS] bnow,
A[range 20 SECONDS slide 60 SECONDS] anow WHERE anow.x = bnow.y;
+SELECT anow.y, bnow.* FROM A[now] anow, B[range 10 SECONDS slide 50
SECONDS] bnow WHERE bnow.y = anow.x AND anow.b>64 AND bnow.a>344 AND
bnow.y<62 AND bnow.a<819 AND bnow.a<179;
+
+SELECT anow.z as ax FROM A[range 50 SECONDS slide 40 SECONDS] anow WHERE
anow.x<921;
+SELECT * FROM A[range 20 SECONDS slide 50 SECONDS] anow;
+SELECT * FROM A[now] anow WHERE anow.z>758;
+SELECT * FROM A[range 20 SECONDS slide 10 SECONDS] anow WHERE anow.b>984;
+SELECT anow.y FROM A[now] anow WHERE anow.b<640 AND anow.y>998 AND
anow.x>220;
+SELECT anow.y FROM A[range 50 SECONDS slide 90 SECONDS] anow;
+SELECT anow.y, anow.z FROM A[range 80 SECONDS slide 50 SECONDS] anow WHERE
anow.x>931;
+SELECT anow.y FROM A[now] anow;
+SELECT anow.b FROM A[range 10 SECONDS slide 80 SECONDS] anow;
+SELECT * FROM A[now] anow WHERE anow.b>417 AND anow.z<214 AND anow.z<547;
+
+SELECT COUNT(anow.b) FROM A[now] anow WHERE anow.y<363;
+SELECT AVG(anow.y) FROM A[now] anow;
+SELECT COUNT(anow.y) FROM A[range 60 SECONDS slide 80 SECONDS] anow WHERE
anow.z>423 AND anow.x>434 AND anow.b>48 AND anow.y>683;
+SELECT MAX(anow.x) FROM A[range 90 SECONDS slide 70 SECONDS] anow WHERE
anow.y<986 AND anow.y>110;
+SELECT COUNT(anow.z) FROM A[range 30 SECONDS slide 80 SECONDS] anow WHERE
anow.y<317 AND anow.z>438 AND anow.y>673 AND anow.z>198;
+SELECT MIN(anow.z) FROM A[now] anow;
+SELECT SUM(anow.z) FROM A[range 20 SECONDS slide 80 SECONDS] anow WHERE
anow.y>626;
+SELECT MIN(anow.x) FROM A[range 60 SECONDS slide 10 SECONDS] anow;
+SELECT AVG(anow.x) FROM A[range 10 SECONDS slide 30 SECONDS] anow;
+SELECT AVG(anow.z) FROM A[range 40 SECONDS slide 20 SECONDS] anow;
+
+SELECT bnow.a, anow.x FROM B[range 10 SECONDS slide 10 SECONDS] bnow,
A[now] anow WHERE anow.x = bnow.y AND anow.x>255 AND anow.y<920;
+SELECT bnow.x, anow.b FROM B[now] bnow, A[range 10 SECONDS slide 10
SECONDS] anow WHERE anow.x = bnow.y AND bnow.y>493 AND bnow.z>124 AND
anow.x<328;
+SELECT anow.b, anow.x, anow.y, bnow.a, bnow.x, bnow.y FROM A[range 10
SECONDS slide 40 SECONDS] anow, B[now] bnow WHERE bnow.y = anow.x AND
bnow.z<163;
+SELECT anow.b, anow.x, anow.y, anow.z, bnow.z FROM A[now] anow, B[range 10
SECONDS slide 80 SECONDS] bnow WHERE bnow.y = anow.x;
+
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Attribute.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,56 @@
+package uk.ac.manchester.snee.client.queryGenerator;
+
+
+// Attribute: Representing an Attribute within a Table
+//
+
+public class Attribute {
+
+ String name;
+ String type;
+ boolean key; // Is this the key?
+ String foreignKeyTable; // The name of any table for which this is FK
+
+ // persistence-capable class types
+
+ /** Creates new MyClass */
+ public Attribute (String theName, String theType, boolean theKey) {
+ name = theName;
+ type = theType;
+ key = theKey;
+ foreignKeyTable = null;
+ }
+
+ public Attribute (String theName, String theType, boolean theKey,
+ String theForeignKeyTable) {
+ name = theName;
+ type = theType;
+ key = theKey;
+ foreignKeyTable = theForeignKeyTable;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public boolean getKey()
+ {
+ return key;
+ }
+
+ public String getForeignKeyTable()
+ {
+ return foreignKeyTable;
+ }
+
+ public String toString()
+ {
+ return "Attribute: " + name + "Of Type" + type + " Key = " + key;
+ }
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Query.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,296 @@
+package uk.ac.manchester.snee.client.queryGenerator;
+
+
+// Query: Representing a SQL Query, which can be generated from randomly
+// selected tables in a given database
+
+
+import java.util.*;
+
+import com.sun.xml.bind.v2.runtime.unmarshaller.XsiNilLoader.Array;
+
+public class Query {
+
+ int id;
+ boolean defined = false;
+
+ String select; // The text of the SELECT clause
+ Vector<Table> from; // The Table objects of the tables in the from
clause
+ String where; // The text of the WHERE clause
+
+ public Query (int theId)
+ {
+ id = theId;
+ defined = false;
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+
+ // Given a database schema consisting of a collection of tables,
+ // a target number of joins, a probability that a local predicate
+ // should be added (iteratively) for each join, and the probability
+ // that a predicate should be an equality, populate the select,
+ // from and where attributes.
+ //
+ public void buildQuery(Vector<?> tables, int numJoins, double predProb,
+ double nowWindowProb, int acqRate,
+ Double allAtributesProb, TPCH.queryType
queryType)
+ {
+ if (tables.size() < numJoins) {
+ System.out.println("Not enough tables to perform " + numJoins
+ " joins on");
+ return;
+ }
+
+ select = "SELECT ";
+ from = new Vector<Table>();
+ where = "WHERE ";
+
+ boolean[] used = new boolean[tables.size()];
+ Arrays.fill(used, (boolean) false);
+
+ boolean firstFilter = true;
+
+ for (int i = 1; i <= numJoins; i++) {
+
+ // Identify the next table to add, avoiding duplicates
+
+ boolean found = false;
+ Table candidateTable = null;
+ String candidateWhere = null;
+ int tablePos = 0;
+
+ while (!found) {
+
+ // First find a random table that hasn't been used
+ Random rnd = new Random();
+ do {
+ tablePos = rnd.nextInt(tables.size());
+ } while (used[tablePos]);
+
+ candidateTable = (Table) tables.get(tablePos);
+ // System.out.println("Candate Table: " +
candidateTable.getName());
+
+ if (i==1)
+ // No existing table to join to
+ found = true;
+ else {
+ // Check to see if it is related to a table
+ // that has been used
+
+ // First: does the candidateTable contain an attribute
that
+ // is a foreign key for any table already in the from
clause?
+ String matchingAttribute = null;
+ Table tableInUse = null;
+ Iterator<Table> it = from.iterator();
+ do {
+ tableInUse = (Table) it.next();
+ matchingAttribute =
candidateTable.getForeignKey(tableInUse.getName());
+ } while (it.hasNext() && matchingAttribute == null);
+
+ found = (matchingAttribute != null);
+
+ if (found) {
+ candidateWhere =
+ candidateTable.getName() + "." +
matchingAttribute +
+ " = " +
+ tableInUse.getName() + "." +
tableInUse.getKey();
+ } else {
+
+ // Second: does a table in the from clause contain
an
+ // attribute that is a foreign key for the
candidateTable?
+ it = from.iterator();
+ do {
+ tableInUse = (Table) it.next();
+ matchingAttribute =
tableInUse.getForeignKey(candidateTable.getName());
+ } while (it.hasNext() && matchingAttribute ==
null);
+
+ found = (matchingAttribute != null);
+
+ if (found) {
+ candidateWhere =
+ candidateTable.getName() + "." +
candidateTable.getKey() +
+ " = " +
+ tableInUse.getName() + "." +
matchingAttribute;
+ }
+ }
+ }
+ }
+
+ used[tablePos] = true;
+
+ // System.out.println("Adding: " + candidateTable.getName());
+ Random rnd = new Random();
+
if(queryType.toString().equals(TPCH.queryType.SELECT.toString()) ||
+ queryType.toString().equals(TPCH.queryType.JOIN.toString()))
+ {
+ if (i > 1)
+ select = select + ", ";
+
+ if(rnd.nextInt(10) > (new
Double(allAtributesProb*10).intValue()))
+ {
+ int numberofAttribputes =
rnd.nextInt(candidateTable.getClonedAttributes().size()-1);
+ if(numberofAttribputes == 0)
+ numberofAttribputes = 1;
+ Vector<Attribute> possibleAttributes =
candidateTable.getClonedAttributes();
+ int done = 0;
+ boolean first = true;
+ while(done < numberofAttribputes)
+ {
+ if(first)
+ {
+ int rnadomIndex =
rnd.nextInt(possibleAttributes.size());
+ select = select + candidateTable.getName() + "." +
+ possibleAttributes.get(rnadomIndex).name;
+ first = false;
+ possibleAttributes.remove(rnadomIndex);
+ }
+ else
+ {
+ int rnadomIndex =
rnd.nextInt(possibleAttributes.size());
+ select = select + ", " + candidateTable.getName()
+ "." +
+ possibleAttributes.get(rnadomIndex).name;
+ possibleAttributes.remove(rnadomIndex);
+ }
+ done++;
+ }
+ }
+ else
+ select = select + candidateTable.getName() + "." + "*";
+ }
+ else
if(queryType.toString().equals(TPCH.queryType.AGG.toString()))
+ {
+ Vector<String> aggregationOperators =
+ new
Vector<String>(Arrays.asList("AVG", "COUNT", "SUM", "MIN", "MAX"));
+ int rnadomAggregationOperatorIndex =
rnd.nextInt(aggregationOperators.size());
+ String aggregationOperator =
aggregationOperators.get(rnadomAggregationOperatorIndex);
+ select = select + aggregationOperator + "(";
+ int attributeIndex =
rnd.nextInt(candidateTable.getAttributes().size());
+ select = select.concat(candidateTable.getName()+ "." +
+ candidateTable.getAttributes().get(attributeIndex).name
+ ") ");
+ }
+
+
+ //Add window definition
+ int randomValue = rnd.nextInt(10);
+ Window win = null;
+ if(randomValue > (new Double(nowWindowProb*10).intValue()))
+ {
+ //range and slide must be multipliers of the acq rate
+ int randomAcqMultiplier = rnd.nextInt(10);
+ int range = acqRate * randomAcqMultiplier;
+ randomAcqMultiplier = rnd.nextInt(10);
+ int slide = acqRate * randomAcqMultiplier;
+ win = new Window(range, slide, Window.timeValue.SECONDS);
+ }
+ else
+ win = new Window();
+ candidateTable.setWindow(win);
+
+ from.add(candidateTable);
+
+
+ if (i == 2)
+ {
+ where = where + candidateWhere;
+ firstFilter = false;
+ }
+ if (i > 2)
+ {
+ where = where + " AND " + candidateWhere;
+ firstFilter = false;
+ }
+ }
+
+ String filter = this.buildFilter(predProb, firstFilter);
+ if (filter.length() > 0) where = where +
this.buildFilter(predProb, firstFilter);
+
+ defined = true;
+ }
+
+ // Given a probability that a further predicate should be added to
+ // each table, add inequality predicates to the attributes of the
+ // table, where they have type VARCHAR, INTEGER or DOUBLE
+ //
+ private String buildFilter(double predProb, boolean firstFilter)
+ {
+ String filter = "";
+
+ Iterator<Table> it = from.iterator();
+ while (it.hasNext())
+ {
+ Table table = (Table) it.next();
+ Vector<?> attributes = table.getAttributes();
+
+ // Add predicates to randomly selected attributes, taking into
+ // account predProb; this assumes that every table has
attributes
+ // that are of type VARCHAR, INTEGER or DECIMAL, and works
better
+ // where there are plenty such attributes
+ int numPreds = 0;
+ Random rnd = new Random();
+ while (rnd.nextDouble() < predProb && numPreds <
attributes.size())
+ {
+ numPreds ++;
+ // Randomly select an attribute to which to add a predicate
+ Attribute attribute = (Attribute)
attributes.get(rnd.nextInt(attributes.size()));
+ String type = attribute.getType();
+
+ String comparisonLiteral = null;
+ // Generate random values to compare with
+ // Random value generation a bit hit or miss
+ if (type.equalsIgnoreCase("INTEGER")) {
+ comparisonLiteral =
Integer.toString(rnd.nextInt(1000));
+ } else if (type.equalsIgnoreCase("DECIMAL")) {
+ comparisonLiteral =
Double.toString(rnd.nextDouble()*1000);
+ } else if (type.equalsIgnoreCase("VARCHAR")) {
+ String s = "aBcDeFgHiJkLmNoPqRsTuVwXyZ";
+ int pos = rnd.nextInt(s.length() - 1);
+ comparisonLiteral = "'" + s.substring(pos,pos+1) + "'";
+ }
+
+ if (comparisonLiteral != null) {
+ String comparisonOperator;
+ // Select a comparison operator at random
+ if (rnd.nextDouble() > 0.5) {
+ comparisonOperator = ">";
+ } else {
+ comparisonOperator = "<";
+ }
+
+ if (filter.length() > 0 || !firstFilter)
+ filter = filter + " AND ";
+
+ filter = filter + table.getName() + "." +
attribute.getName() +
+ comparisonOperator + comparisonLiteral;
+ }
+ }
+ }
+ return filter;
+ }
+
+
+ public String toString()
+ {
+ if (defined)
+ {
+ String theSQL = select + " FROM ";
+ for (int i = 1; i <= from.size(); i++)
+ {
+ if (i > 1) theSQL = theSQL + ", ";
+ Table table = (Table) from.get(i - 1);
+ theSQL = theSQL + table.getName() +
table.getWindow().toString();
+ }
+ if(!where.equals("WHERE "))
+ theSQL = theSQL + " " + where;
+
+ return theSQL;
+
+ } else {
+
+ return "Undefined";
+
+ }
+ }
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/TPCH.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,178 @@
+package uk.ac.manchester.snee.client.queryGenerator;
+
+
+// TPCH: Generate Example Queries Based on TPC-H Schema
+
+import java.util.*;
+
+public class TPCH {
+
+ public static enum queryType{SELECT, AGG, JOIN}
+
+ public static void main(String[] args) {
+ int QoSAcqusitionRate = 10;
+ double probabilyOfAllAttributes = 0.5;
+ Vector<Attribute> A = new Vector<Attribute>();
+
+ A.add(new Attribute("x","INTEGER",true));
+ A.add(new Attribute("y","INTEGER",false));
+ A.add(new Attribute("z","INTEGER",false));
+ A.add(new Attribute("a","INTEGER",false));
+
+ Table a = new Table("A", A);
+
+ Vector<Attribute> B = new Vector<Attribute>();
+
+ B.add(new Attribute("x","INTEGER",true));
+ B.add(new Attribute("y","INTEGER",true,"A"));
+ B.add(new Attribute("z","INTEGER",false));
+ B.add(new Attribute("a","INTEGER",false));
+
+ Table b = new Table("B", B);
+
+ // ----------------------------------------------
+
+ Vector<Attribute> regionAtts = new Vector<Attribute>();
+
+ regionAtts.add(new Attribute("R_REGIONKEY","INTEGER",true));
+ regionAtts.add(new Attribute("R_NAME","VARCHAR",false));
+ regionAtts.add(new Attribute("R_COMMENT","VARCHAR",false));
+
+ Table region = new Table("REGION", regionAtts);
+
+
+
+ Vector<Attribute> partAtts = new Vector<Attribute>();
+
+ partAtts.add(new Attribute("P_PARTKEY","INTEGER",true));
+ partAtts.add(new Attribute("P_NAME","VARCHAR",false));
+ partAtts.add(new Attribute("P_MFRG","VARCHAR",false));
+ partAtts.add(new Attribute("P_BRAND","VARCHAR",false));
+ partAtts.add(new Attribute("P_TYPE","VARCHAR",false));
+ partAtts.add(new Attribute("P_SIZE","INTEGER",false));
+ partAtts.add(new Attribute("P_CONTAINER","VARCHAR",false));
+ partAtts.add(new Attribute("P_RETAILPRICE","DECIMAL",false));
+ partAtts.add(new Attribute("P_COMMENT","VARCHAR",false));
+
+ Table part = new Table("PART", partAtts);
+
+
+
+ Vector<Attribute> supplierAtts = new Vector<Attribute>();
+
+ supplierAtts.add(new Attribute("S_SUPPKEY","INTEGER",true));
+ supplierAtts.add(new Attribute("S_NAME","VARCHAR",false));
+ supplierAtts.add(new Attribute("S_ADDRESS","VARCHAR",false));
+ supplierAtts.add(new
Attribute("S_NATIONKEY","INTEGER",true,"NATION"));
+ supplierAtts.add(new Attribute("S_PHONE","VARCHAR",false));
+ supplierAtts.add(new Attribute("S_ACCTBAL","DECIMAL",false));
+ supplierAtts.add(new Attribute("S_COMMENT","VARCHAR",false));
+
+ Table supplier = new Table("SUPPLIER", supplierAtts);
+
+
+
+ Vector<Attribute> psAtts = new Vector<Attribute>();
+
+ psAtts.add(new Attribute("PS_PARTKEY","INTEGER",true,"PART"));
+ psAtts.add(new Attribute("PS_SUPPKEY","INTEGER",true,"SUPPLIER"));
+ psAtts.add(new Attribute("PS_AVAILQTY","INTEGER",false));
+ psAtts.add(new Attribute("PS_SUPPLYCOST","DECIMAL",false));
+ psAtts.add(new Attribute("PS_COMMENT","VARCHAR",false));
+
+ Table ps = new Table("PARTSUPP", psAtts);
+
+
+
+ Vector<Attribute> custAtts = new Vector<Attribute>();
+
+ custAtts.add(new Attribute("C_CUSTKEY","INTEGER",true));
+ custAtts.add(new Attribute("C_NAME","CARCHAR",false));
+ custAtts.add(new Attribute("C_ADDRESS","VARCHAR",false));
+ custAtts.add(new
Attribute("C_NATIONKEY","INTEGER",false,"NATION"));
+ custAtts.add(new Attribute("C_PHONE","VARCHAR",false));
+ custAtts.add(new Attribute("C_ACCBAL","DECIMAL",false));
+ custAtts.add(new Attribute("C_MKTSEGMENT","VARCHAR",false));
+ custAtts.add(new Attribute("C_COMMENT","VARCHAR",false));
+
+ Table cust = new Table("CUSTOMER", custAtts);
+
+
+
+ Vector<Attribute> orderAtts = new Vector<Attribute>();
+
+ orderAtts.add(new Attribute("O_ORDERKEY","INTEGER",true));
+ orderAtts.add(new
Attribute("O_CUSTKEY","INTEGER",true,"CUSTOMER"));
+ orderAtts.add(new Attribute("O_ORDERSTATUS","VARCHAR",false));
+ orderAtts.add(new Attribute("O_TOTALPRICE","DECIMAL",false));
+ orderAtts.add(new Attribute("O_ORDERDATE","DATE",false));
+ orderAtts.add(new Attribute("O_ORDERPRIORITY","VARCHAR",false));
+ orderAtts.add(new Attribute("O_CLERK","VARCHAR",false));
+ orderAtts.add(new Attribute("O_SHIPPRIORITY","INTEGER",false));
+ orderAtts.add(new Attribute("O_COMMENT","VARCHAR",false));
+
+ Table orders = new Table("ORDERS", orderAtts);
+
+
+
+ Vector<Attribute> lineitemAtts = new Vector<Attribute>();
+
+ lineitemAtts.add(new
Attribute("L_ORDERKEY","INTEGER",true,"ORDER"));
+ lineitemAtts.add(new Attribute("L_PARTKEY","INTEGER",true,"PART"));
+ lineitemAtts.add(new
Attribute("L_SUPPKEY","INTEGER",true,"SUPPLIER"));
+ lineitemAtts.add(new Attribute("L_LINENUMBER","INTEGER",false));
+ lineitemAtts.add(new Attribute("L_QUANTITY","DECIMAL",false));
+ lineitemAtts.add(new Attribute("L_EXTENDEDPRICE","DECIMAL",false));
+ lineitemAtts.add(new Attribute("L_DISCOUNT","DECIMAL",false));
+ lineitemAtts.add(new Attribute("L_TAX","DECIMAL",false));
+ lineitemAtts.add(new Attribute("L_RETURNFLAG","VARCHAR",false));
+ lineitemAtts.add(new Attribute("L_LINESTATUS","VARCHAR",false));
+ lineitemAtts.add(new Attribute("L_SHIPDATE","DATE",false));
+ lineitemAtts.add(new Attribute("L_COMMITDATE","DATE",false));
+ lineitemAtts.add(new Attribute("L_RECEIPTDATE","DATE",false));
+
+ Table lineitem = new Table("LINEITEM", lineitemAtts);
+
+
+
+ Vector<Table> tables = new Vector<Table>();
+ tables.add(a);
+ tables.add(b);
+ //tables.add(region);
+ //tables.add(part);
+ //tables.add(supplier);
+ //tables.add(ps);
+ //tables.add(cust);
+ //tables.add(orders);
+ //tables.add(lineitem);
+
+ // ----------------------------------------------
+ /*
+ for(int index =0; index<20; index++)
+ {
+ Query q = new Query(1);
+ q.buildQuery(tables, 1, 0.7, 0.2,
+ QoSAcqusitionRate, probabilyOfAllAttributes,
+ queryType.SELECT);
+ System.out.println(q.toString());
+ }
+ for(int index =0; index<20; index++)
+ {
+ Query q = new Query(1);
+ q.buildQuery(tables, 1, 0.7, 0.2,
+ QoSAcqusitionRate, probabilyOfAllAttributes,
+ queryType.AGG);
+ System.out.println(q.toString());
+ }*/
+ for(int index =0; index<20; index++)
+ {
+ Query q = new Query(1);
+ q.buildQuery(tables, 2, 0.7, 0.2,
+ QoSAcqusitionRate, probabilyOfAllAttributes,
+ queryType.JOIN);
+ System.out.println(q.toString()+";");
+ }
+
+
+ }
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Table.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,91 @@
+package uk.ac.manchester.snee.client.queryGenerator;
+
+
+// Table: Representing a Relation Over Which Queries May Act
+//
+
+import java.util.*;
+
+public class Table {
+
+ String name;
+ Vector<Attribute> attributes;
+ Window window;
+
+ // persistence-capable class types
+
+ /** Creates new MyClass */
+ public Table (String theName, Vector<Attribute> theAttributes) {
+ name = theName;
+ attributes = theAttributes;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Vector<Attribute> getAttributes()
+ {
+ return attributes;
+ }
+
+ // Return the name of the first key attribute.
+ // Assumes there is a key attribute
+ public String getKey()
+ {
+ Attribute att = null;
+ Iterator<?> i = attributes.iterator();
+ do {
+ att = (Attribute) i.next();
+ } while (i.hasNext() && !att.getKey());
+
+ return att.getName();
+ }
+
+ // Given the name of a table, return the name of any
+ // attribute that is a foreign key for that table
+ public String getForeignKey(String tableName)
+ {
+ Attribute att = null;
+ String res = null;
+ boolean found = false;
+ Iterator<Attribute> i = attributes.iterator();
+ do {
+ att = (Attribute) i.next();
+ String fk = att.getForeignKeyTable();
+ if (fk != null && fk.equalsIgnoreCase(tableName)) {
+ found = true;
+ res = att.getName();
+ }
+ } while (i.hasNext() && !found);
+
+ return res;
+ }
+
+ public String toString()
+ {
+ return "Table: " + name + window.toString();
+ }
+
+ public void setWindow(Window win)
+ {
+ window = win;
+ }
+
+ public Window getWindow()
+ {
+ return window;
+ }
+
+ public Vector<Attribute> getClonedAttributes()
+ {
+ Iterator<Attribute> attributeIteratoer = attributes.iterator();
+ Vector<Attribute> clone = new Vector<Attribute>();
+ while(attributeIteratoer.hasNext())
+ {
+ clone.add(attributeIteratoer.next());
+ }
+ return clone;
+ }
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/queryGenerator/Window.java
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,32 @@
+package uk.ac.manchester.snee.client.queryGenerator;
+
+public class Window
+{
+ private boolean nowWindow;
+ private int range;
+ private int slide;
+ private timeValue time;
+ public static enum timeValue {SECONDS, MINUTES}
+
+ public Window()
+ {
+ nowWindow = true;
+ }
+
+ public Window(int range, int slide, timeValue time)
+ {
+ nowWindow = false;
+ this.range = range;
+ this.slide =slide;
+ this.time = time;
+ }
+
+ public String toString()
+ {
+ if(nowWindow)
+ return "[now] ";
+ else
+ return "[range " + range + " " + time.toString() + " slide "+ slide
+ " " + time.toString() +"]";
+ }
+
+}
=======================================
--- /dev/null
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/resources/testsSize100/QUERIESgENERATED
Fri Oct 18 16:26:33 2013 UTC
@@ -0,0 +1,32 @@
+SELECT A.a as ax FROM A[range 50 SECONDS slide 40 SECONDS] WHERE A.x<921
+SELECT A.* FROM A[range 40 SECONDS slide 50 SECONDS]
+SELECT A.* FROM A[now] WHERE A.z>758
+SELECT A.* FROM A[range 70 SECONDS slide 10 SECONDS] WHERE A.a>984
+SELECT A.y FROM A[now] WHERE A.a<640 AND A.y>998 AND A.x>220
+SELECT A.y FROM A[range 50 SECONDS slide 90 SECONDS]
+SELECT A.y, A.z FROM A[range 80 SECONDS slide 50 SECONDS] WHERE A.x>931
+SELECT A.y FROM A[now]
+SELECT A.a FROM A[range 0 SECONDS slide 80 SECONDS]
+SELECT A.* FROM A[now] WHERE A.a>417 AND A.z<214 AND A.z<547
+
+SELECT COUNT(A.a) FROM A[now] WHERE A.y<363
+SELECT AVG(A.y) FROM A[now]
+SELECT COUNT(A.y) FROM A[range 60 SECONDS slide 80 SECONDS] WHERE A.z>423
AND A.x>434 AND A.a>48 AND A.y>683
+SELECT MAX(A.x) FROM A[range 90 SECONDS slide 70 SECONDS] WHERE A.y<986
AND A.y>110
+SELECT COUNT(A.z) FROM A[range 30 SECONDS slide 80 SECONDS] WHERE A.y<317
AND A.z>438 AND A.y>673 AND A.z>198
+SELECT MIN(A.z) FROM A[now]
+SELECT SUM(A.z) FROM A[range 20 SECONDS slide 80 SECONDS] WHERE A.y>626
+SELECT MIN(A.x) FROM A[range 60 SECONDS slide 10 SECONDS]
+SELECT AVG(A.x) FROM A[range 10 SECONDS slide 30 SECONDS]
+SELECT AVG(A.z) FROM A[range 40 SECONDS slide 20 SECONDS]
+
+SELECT B.a, A.* FROM B[range 90 SECONDS slide 10 SECONDS], A[now] WHERE
A.x = B.y AND A.x>255 AND A.y<920
+SELECT B.*, A.a FROM B[range 30 SECONDS slide 10 SECONDS], A[range 60
SECONDS slide 10 SECONDS] WHERE A.x = B.y AND B.y>493 AND B.z>124 AND
A.x<328
+SELECT A.*, B.* FROM A[range 50 SECONDS slide 40 SECONDS], B[now] WHERE
B.y = A.x AND B.z<163
+SELECT A.*, B.z FROM A[now] , B[range 40 SECONDS slide 80 SECONDS] WHERE
B.y = A.x
+SELECT A.z, B.* FROM A[range 20 SECONDS slide 20 SECONDS], B[now] WHERE
B.y = A.x AND A.y>157 AND B.z<53
+SELECT B.*, A.* FROM B[now] , A[now] WHERE A.x = B.y AND B.y>856 AND
B.a<56 AND A.y<705 AND A.a<700 AND A.a<546 AND A.a<194
+SELECT B.*, A.x FROM B[now] , A[range 70 SECONDS slide 10 SECONDS] WHERE
A.x = B.y AND A.y>736
+SELECT B.a, A.* FROM B[range 20 SECONDS slide 50 SECONDS], A[range 40
SECONDS slide 50 SECONDS] WHERE A.x = B.y
+SELECT B.*, A.* FROM B[range 10 SECONDS slide 90 SECONDS], A[range 20
SECONDS slide 60 SECONDS] WHERE A.x = B.y
+SELECT A.y, B.* FROM A[now] , B[range 20 SECONDS slide 50 SECONDS] WHERE
B.y = A.x AND A.a>64 AND B.a>344 AND B.y<62 AND B.a<819 AND B.a<179
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/java/uk/ac/manchester/snee/client/SNEEFailedNodeEvalClientUsingInNetworkSource.java
Fri Aug 30 13:53:42 2013 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/java/uk/ac/manchester/snee/client/SNEEFailedNodeEvalClientUsingInNetworkSource.java
Fri Oct 18 16:26:33 2013 UTC
@@ -58,13 +58,13 @@
@SuppressWarnings("unused")
private String sneeProperties;
private static boolean inRecoveryMode = false;
- private static int queryid = 1;
+ private static int queryid = 2;
protected static int testNo = 2;
private static SensorNetworkQueryPlan qep;
private static ClientUtils utils = new ClientUtils();
- private static int max = 5;
- private static File testFolder = new
File("src/main/resources/testsSize30");
- private static File sneetestFolder = new File("testsSize30");
+ private static int max = 80;
+ private static File testFolder = new
File("src/main/resources/testsSize100");
+ private static File sneetestFolder = new File("testsSize100");

public SNEEFailedNodeEvalClientUsingInNetworkSource(String query,
double duration, String queryParams, String csvFile, String
sneeProperties)
@@ -106,7 +106,7 @@

queryIterator = queries.iterator();
failedOutput = createFailedTestListWriter();
-
+
//TODO remove to allow full run
while(queryIterator.hasNext() && queryid <= max)
{
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/resources/etc/query-parameters.xml
Mon Aug 19 13:57:16 2013 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failed-node-eval-client/src/main/resources/etc/query-parameters.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -17,8 +17,8 @@
<units>SECONDS</units>
<constraint>
<range>
- <min-val>300</min-val>
- <max-val>300</max-val>
+ <min-val>10</min-val>
+ <max-val>10</max-val>
</range>
</constraint>
<weighting>1</weighting>
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/SNEEFailedNodeEvalClientUsingInNetworkSourceTimeDelay.java
Fri Aug 30 13:53:42 2013 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/java/uk/ac/manchester/snee/client/SNEEFailedNodeEvalClientUsingInNetworkSourceTimeDelay.java
Fri Oct 18 16:26:33 2013 UTC
@@ -59,12 +59,12 @@

Logger.getLogger(SNEEFailedNodeEvalClientUsingInNetworkSourceTimeDelay.class.getName());
@SuppressWarnings("unused")
private String sneeProperties;
- private static int queryid = 31 ;
+ private static int queryid = 62 ;
protected static int testNo = 1;
- private static String dictonary = "testsSize30";
+ private static String dictonary = "testsSize100";

//used to calculate agenda cycles
- protected static int maxNumberofFailures = 8;
+ protected static int maxNumberofFailures = 2;
protected static ArrayList<String> currentlyFailedNodes = new
ArrayList<String>(maxNumberofFailures);
protected static double originalLifetime;
protected static int numberOfExectutionCycles;
@@ -116,15 +116,19 @@
queryIterator = queries.iterator();
failedOutput = utils.createFailedTestListWriter();

- for(int index =1; index < queryid; index++)
- {
- queryIterator.next();
- }
+ // for(int index =1; index < queryid; index++)
+ // {
+ // queryIterator.next();
+ // }

// while(queryIterator.hasNext())
// {
+ for(int index = 0; index < 10; index++)
+ {
recursiveRun(queryIterator, duration, queryParams, false,
failedOutput);
calculated = false;
+ queryid++;
+ }
// }
failedOutput.write("\\end{document}");
failedOutput.flush();
@@ -162,7 +166,9 @@
{
//get query & schemas
String currentQuery = queryIterator.next();
- String propertiesPath = dictonary + "/snee" + queryid + ".properties";
+ // currentQuery = "SELECT RSTREAM anow.x, anow.y as qx FROM A[NOW]
anow;";
+ //currentQuery = "SELECT RSTREAM anow.x as qx FROM A[now] anow, B[now]
bnow WHERE anow.x=bnow.x AND anow.y>bnow.y;";
+ String propertiesPath = dictonary + "/snee" + "62" + ".properties";

System.out.println("Running Tests on query " + (queryid));
client = new
SNEEFailedNodeEvalClientUsingInNetworkSourceTimeDelay(currentQuery,
@@ -239,7 +245,7 @@
testNo = 1 + (cap * (position));
System.out.println("running tests for partial ");

SNEEProperties.setSetting(SNEEPropertyNames.CHOICE_ASSESSOR_PREFERENCE,
ChoiceAssessorPreferenceEnum.Partial.toString());
-
+ System.out.println("original lf = " +
SNEEFailedNodeEvalClientUsingInNetworkSourceTimeDelay.getOriginalLifetime());
//run for partial
for(int currentNumberOfFailures = 1; currentNumberOfFailures <=
maxNumberofFailures; currentNumberOfFailures++)
{
@@ -509,7 +515,7 @@
private static void collectQueries(ArrayList<String> queries) throws
IOException
{
//String filePath = Utils.validateFileLocation("tests/queries.txt");
- File queriesFile = new File("src/main/resources/" + dictonary
+ "/queries.txt");
+ File queriesFile = new File("src/main/resources/" + dictonary
+ "/QUERIESgENERATED");
String filePath = queriesFile.getAbsolutePath();
BufferedReader queryReader = new BufferedReader(new
FileReader(filePath));
String line = "";
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query1.xml
Tue Jan 31 12:40:41 2012 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query1.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -8,6 +8,15 @@
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
+ <column name="z">
+ <type class ="integer"/>
+ </column>
+ <column name="a">
+ <type class ="integer"/>
+ </column>
</stream>

</schema>
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query2.xml
Tue Jan 31 12:40:41 2012 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query2.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -8,6 +8,15 @@
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
+ <column name="z">
+ <type class ="integer"/>
+ </column>
+ <column name="b">
+ <type class ="integer"/>
+ </column>
</stream>

</schema>
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query62.xml
Tue Jan 31 12:40:41 2012 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize100/logicalSchema_query62.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -8,11 +8,29 @@
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
+ <column name="z">
+ <type class ="integer"/>
+ </column>
+ <column name="b">
+ <type class ="integer"/>
+ </column>
</stream>
<stream name="B" type="pull">
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
+ <column name="z">
+ <type class ="integer"/>
+ </column>
+ <column name="a">
+ <type class ="integer"/>
+ </column>
</stream>
<stream name="C" type="pull">
<column name="x">
@@ -24,5 +42,7 @@
<type class ="integer"/>
</column>
</stream>
+
+

</schema>
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize30/logicalSchema_query2.xml
Tue Jan 31 12:59:12 2012 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize30/logicalSchema_query2.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -8,6 +8,12 @@
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
+ <column name="z">
+ <type class ="integer"/>
+ </column>
</stream>

</schema>
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize30/logicalSchema_query60.xml
Tue Jan 31 12:59:12 2012 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/failedNodeEvalClientTimeIntergrated/src/main/resources/testsSize30/logicalSchema_query60.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -8,11 +8,17 @@
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
</stream>
<stream name="B" type="pull">
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
</stream>
<stream name="C" type="pull">
<column name="x">
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/autoPlotter/PlotFolderGenerators.java
Mon Aug 19 13:57:16 2013 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/java/uk/ac/manchester/snee/client/autoPlotter/PlotFolderGenerators.java
Fri Oct 18 16:26:33 2013 UTC
@@ -18,11 +18,11 @@
{
static private HashMap<String, Query> queries = new HashMap<String,
Query>();
static private File tupleInputFile = null;
- static private File lifetimeInputFile = new
File("/mnt/usb/1st1/edgeResults/data/lifetimeAndVarience");
+ static private File lifetimeInputFile = new
File("/mnt/usb/1st1/Edge/edge_failure_overview_plots/curves/data/lifetimeAndVarience");
static private File outputFolder = null;
static private File outputFolderRoot = new
File("/mnt/usb/1st1/edgeResults/plots/");
static private String sep = File.separator;
- static private File startupDataFolder = new
File("/mnt/usb/1st1/edgeResults/data");
+ static private File startupDataFolder = new
File("/mnt/usb/1st1/Edge/edge_failure_overview_plots/curves/data");


public static void main(String [] args)
@@ -48,6 +48,9 @@
outputDistanceFolder = "32m";
if(distances[distanceIndex].getName().equals("aggre1.0"))
outputDistanceFolder = "40m";
+
+ if(!outputFolderRoot.exists())
+ outputFolderRoot.mkdir();

outputFolder = new File(outputFolderRoot.toString() + sep +
typeOfNoise.getName() + sep + outputDistanceFolder);
File queryTypeFolder = new File(outputFolderRoot.toString() +
sep + typeOfNoise.getName());
@@ -85,10 +88,16 @@
" 40000, \"50\" 50000, \"60\" 60000, \"70\" 70000, \"80\" 80000 " +
", \"90\" 90000, \"100\" 100000, \"110\" 110000, \"120\" 120000) \n" +
"set ytic (0,10,20,30,40,50,60,70,80,90,100) \n " +
- "plot \""+mainDataFileDirectory.getAbsolutePath() + "\" u 1:4 w
linespoints lc rgb \"blue\" " +
- "pt 5 lt 3 ps 2 title \"K_e = 2 & K_n >= K_e\"," +
- " \""+mainDataFileDirectory.getAbsolutePath() + "\" u 8:11 w
linespoints lc rgb \"red\" " +
+ "plot \""+mainDataFileDirectory.getAbsolutePath() + "\" u 22:25 w
linespoints lc rgb" +
+ " \"green\" pt 5 lt 3 ps 2 title \"k_e =1 && k_n = 1 (Static)\", " +
+" \""+mainDataFileDirectory.getAbsolutePath() + "\" u 8:11 w linespoints
lc rgb \"red\" " +
"pt 5 lt 3 ps 2 title \"K_e = 1 & K_n >= K_e (optimistic)\", " +
+" \""+mainDataFileDirectory.getAbsolutePath() + "\" u 1:4 w linespoints lc
rgb \"blue\" " +
+ "pt 5 lt 3 ps 2 title \"K_e = 2 & K_n >= K_e\"," +
+" \""+mainDataFileDirectoryk3.getAbsolutePath() + "\" u 1:4 w linespoints
lc rgb \"orange\" " +
+ "pt 5 lt 3 ps 2 title \"K_e = 3 & K_n >= K_e\"," +
+" \""+mainDataFileDirectory.getAbsolutePath() + "\" u 15:18 w linespoints
lc rgb" +
+ " \"brown\" pt 5 lt 3 ps 1 title \"K_e = K_n (Pessimistic)\", " +
"\""+mainDataFileDirectory.getAbsolutePath() + "\" u 8:11:9:10 w
xerrorbars lc rgb \"black\" " +
"lt 1 pt 4 ps 2 notitle, \""+mainDataFileDirectory.getAbsolutePath()
+ "\" u 8:11:12:13 w " +
"yerrorbars lc rgb \"black\" lt 1 pt 4 ps 2 notitle," +
@@ -96,19 +105,15 @@
" \""+DataOptDirectory2.getAbsolutePath() + "\" u 1:2:3 w labels
offset -2.5,-1 notitle," +
" \""+DataOptDirectory3.getAbsolutePath() + "\" u 1:2:3 w labels
offset +2.5,-1 notitle," +
" \""+DataOptDirectory4.getAbsolutePath() + "\" u 1:2:3 w labels
offset +2.5,+1 notitle," +
- " \""+mainDataFileDirectory.getAbsolutePath() + "\" u 22:25 w
linespoints lc rgb" +
- " \"green\" pt 5 lt 3 ps 2 title \"k_e =1 && k_n = 1 (Static)\"" +
- ", \""+mainDataFileDirectory.getAbsolutePath() + "\" u 22:25:23:24 w
xerrorbars lc rgb \"black\" " +
+ " \""+mainDataFileDirectory.getAbsolutePath() + "\" u 22:25:23:24 w
xerrorbars lc rgb \"black\" " +
"lt 1 pt 4 ps 2 notitle, \""+mainDataFileDirectory.getAbsolutePath()
+ "\" u 22:25:26:27 w " +
- "yerrorbars lc rgb \"black\" lt 1 pt 4 ps 2 notitle," +
+ "yerrorbars lc rgb \"black\" lt 1 pt 4 ps 2 title \"variance from
different topologies\"," +
" \""+mainDataFileDirectory.getAbsolutePath() + "\" u 22:25:28 w
labels offset -2.5,-0.5 notitle," +
- " \""+mainDataFileDirectoryk3.getAbsolutePath() + "\" u 1:4 w
linespoints lc rgb \"orange\" " +
- "pt 5 lt 3 ps 2 title \"K_e = 3 & K_n >= K_e\",
\""+mainDataFileDirectoryk3.getAbsolutePath() + "\"" +
+ " \""+mainDataFileDirectoryk3.getAbsolutePath() + "\"" +
" u 1:4:3:2 w xerrorbars lc rgb \"black\" lt 1 pt 4 ps 2 notitle," +
" \""+mainDataFileDirectoryk3.getAbsolutePath() + "\" u 1:4:5:6 w
yerrorbars lc rgb \"black\" " +
"lt 1 pt 4 ps 2 notitle, \""+mainDataFileDirectoryk3.getAbsolutePath()
+ "\" u 1:4:7 w labels offset" +
- " -2.5,-0.5 notitle, \""+mainDataFileDirectory.getAbsolutePath() + "\"
u 15:18 w linespoints lc rgb" +
- " \"brown\" pt 5 lt 3 ps 1 title \"K_e = K_n (Pessimistic)\", " +
+ " -2.5,-0.5 notitle," +
"\""+mainDataFileDirectory.getAbsolutePath() + "\" u 15:18:16:17 w
xerrorbars lc rgb \"black\" " +
"lt 1 pt 4 ps 1 notitle, \""+mainDataFileDirectory.getAbsolutePath()
+ "\" u 15:18:19:20 w " +
"yerrorbars lc rgb \"black\" lt 1 pt 4 ps 1 notitle," +
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/resources/testsSize100/logicalSchema_query2.xml
Thu Aug 23 09:56:12 2012 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/clients/reliable-channel-client/src/main/resources/testsSize100/logicalSchema_query2.xml
Fri Oct 18 16:26:33 2013 UTC
@@ -8,6 +8,15 @@
<column name="x">
<type class ="integer"/>
</column>
+ <column name="y">
+ <type class ="integer"/>
+ </column>
+ <column name="z">
+ <type class ="integer"/>
+ </column>
+ <column name="a">
+ <type class ="integer"/>
+ </column>
</stream>

</schema>
=======================================
---
/branches/alan_2012_07_19_unreliableChannels/snee-wsn-manager/src/main/java/uk/ac/manchester/cs/snee/manager/planner/costbenifitmodel/ChoiceAssessor.java
Fri Aug 30 13:53:42 2013 UTC
+++
/branches/alan_2012_07_19_unreliableChannels/snee-wsn-manager/src/main/java/uk/ac/manchester/cs/snee/manager/planner/costbenifitmodel/ChoiceAssessor.java
Fri Oct 18 16:26:33 2013 UTC
@@ -259,6 +259,7 @@
{
resetRunningSitesAdaptCost();
}
+ new AdaptationUtils(orginal,
_metadataManager.getCostParameters()).FileOutput(AssessmentFolder);
return true;
}catch(Exception e)
{
Reply all
Reply to author
Forward
0 new messages