com.yobotics.simulationconstructionset.util.simulationRunner
Class StateFileComparer

java.lang.Object
  extended by com.yobotics.simulationconstructionset.util.simulationRunner.StateFileComparer

public class StateFileComparer
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2007

Company:

Version:
1.0
Author:
not attributable

Constructor Summary
StateFileComparer()
           
 
Method Summary
static java.util.ArrayList<VariableDifference> absoluteCompareStateFiles(java.io.File fileOne, java.io.File fileTwo, double maxAbsoluteDiff, java.util.ArrayList<java.lang.String> exceptions)
          Compares two state files and returns a list of variables that differ by more than a given amount.
static java.util.ArrayList<VariableDifference> absoluteCompareStateFiles(java.lang.String filenameOne, java.lang.String filenameTwo, double maxAbsoluteDiff, java.util.ArrayList<java.lang.String> exceptions)
          Compares two state files and returns a list of variables that differ by more than a given amount.
static java.util.ArrayList<VariableDifference> compareVarLists(VarList varListOne, VarList varListTwo, double maxDifferenceAllowed, boolean checkForPercentDifference, java.util.List<java.lang.String> exceptions)
           
static void main(java.lang.String[] args)
           
static java.util.ArrayList<VariableDifference> percentualCompareStateFiles(java.io.File fileOne, java.io.File fileTwo, double maxPercentDiff, java.util.List<java.lang.String> exceptions)
          Compares two state files and returns a list of variables that differ by more than a given percentage.
static java.util.ArrayList<VariableDifference> percentualCompareStateFiles(java.lang.String filenameOne, java.lang.String filenameTwo, double maxPercentDiff, java.util.ArrayList<java.lang.String> exceptions)
          Compares two state files and returns a list of variables that differ by more than a given percentage.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateFileComparer

public StateFileComparer()
Method Detail

absoluteCompareStateFiles

public static java.util.ArrayList<VariableDifference> absoluteCompareStateFiles(java.lang.String filenameOne,
                                                                                java.lang.String filenameTwo,
                                                                                double maxAbsoluteDiff,
                                                                                java.util.ArrayList<java.lang.String> exceptions)
Compares two state files and returns a list of variables that differ by more than a given amount. If variables differ, those variables' values are set to the absolute difference.

Parameters:
filenameOne - file name for first state file
filenameTwo - file name for second state file
maxAbsoluteDiff - max difference percentage between each YoVariable in state file 1 and state file 2
exceptions - variables to skip while comparing state files
Returns:
a VarList containing the YoVariables from state file one that differ more than maxAbsoluteDiff from those in state file 2

absoluteCompareStateFiles

public static java.util.ArrayList<VariableDifference> absoluteCompareStateFiles(java.io.File fileOne,
                                                                                java.io.File fileTwo,
                                                                                double maxAbsoluteDiff,
                                                                                java.util.ArrayList<java.lang.String> exceptions)
Compares two state files and returns a list of variables that differ by more than a given amount. If variables differ, those variables' values are set to the absolute difference.

Parameters:
fileOne - file name for first state file
fileTwo - file name for second state file
maxAbsoluteDiff - max difference percentage between each YoVariable in state file 1 and state file 2
exceptions - variables to skip while comparing state files
Returns:
a VarList containing the YoVariables from state file one that differ more than maxAbsoluteDiff from those in state file 2

percentualCompareStateFiles

public static java.util.ArrayList<VariableDifference> percentualCompareStateFiles(java.lang.String filenameOne,
                                                                                  java.lang.String filenameTwo,
                                                                                  double maxPercentDiff,
                                                                                  java.util.ArrayList<java.lang.String> exceptions)
Compares two state files and returns a list of variables that differ by more than a given percentage. If variables differ, those variables' values are set to the percentage difference.

Parameters:
filenameOne - file name for first state file
filenameTwo - file name for second state file
maxPercentDiff - max difference percentage between each YoVariable in state file 1 and state file 2
exceptions - variables to skip while comparing state files
Returns:
a VarList containing the YoVariables from state file one that differ more than maxPercentDiff from those in state file 2

percentualCompareStateFiles

public static java.util.ArrayList<VariableDifference> percentualCompareStateFiles(java.io.File fileOne,
                                                                                  java.io.File fileTwo,
                                                                                  double maxPercentDiff,
                                                                                  java.util.List<java.lang.String> exceptions)
Compares two state files and returns a list of variables that differ by more than a given percentage. If variables differ, those variables' values are set to the percentage difference.

Parameters:
file1 - first state file
file2 - second state file
maxPercentDiff - max difference percentage between each YoVariable in state file 1 and state file 2
exceptions - variables to skip while comparing state files
Returns:
a VarList containing the YoVariables from state file one that differ more than maxPercentDiff from those in state file 2

compareVarLists

public static java.util.ArrayList<VariableDifference> compareVarLists(VarList varListOne,
                                                                      VarList varListTwo,
                                                                      double maxDifferenceAllowed,
                                                                      boolean checkForPercentDifference,
                                                                      java.util.List<java.lang.String> exceptions)

main

public static void main(java.lang.String[] args)