public class SemanticInterpreterGrid
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private EditableReportProperties |
EP |
SemanticInterpreterGrid |
fatherGrid |
private int[] |
Gravity |
private int |
GridSize |
private java.lang.String |
imgDir |
SemanticNode[][] |
labels |
static int |
NUMBER_OF_REGIONS |
private QMContainer |
qm |
private int |
Region |
java.util.HashMap<java.lang.Integer,SemanticClass>[] |
SemanticClasses |
java.util.HashMap<java.lang.Integer,SemanticClass> |
SemanticClassesIndex |
private TestRunResult |
TestRun |
int |
totalEmptyNodes |
private int |
type |
Unit[] |
units |
int |
XLength |
int |
YLength |
Constructor and Description |
---|
SemanticInterpreterGrid(Unit[] units,
TestRunResult testrun,
boolean master,
int Region,
int type,
java.lang.String imgDir) |
Modifier and Type | Method and Description |
---|---|
void |
addClasstoGrid(int j)
adds a class from ClassCointainer to this SemanticClass Hashmap, used if the Grid is non Regular
|
private java.util.ArrayList<java.lang.Integer> |
compareArrayLists(java.util.ArrayList<java.lang.Integer> a1,
java.util.ArrayList<java.lang.Integer> a2)
Compares two array lists and return how many elements are equal
FIXME: move to a generic utility class |
private int[] |
computeAxisPartition(int axislength)
Combines the used partitions for one axis (for easier handling)
|
private int[] |
computeMiddlePartition(int axislength)
Computes the Middle Partition (& let it grow) for the given axis
|
private int[] |
computeSidePartition(int axislength,
int type)
Computes the areas for the left(type==1) or right (type==2) side of the Middle part for the given Axis and
divides the parts equally among the granularity measures defines by the [] Gravity
|
int[] |
concatArrays(int[] a,
int[] b)
Concatenates two arrays.
|
void |
createClassReport(int j)
Creates a Class Report on Class with index j, saves it in the SemantiClass currClass and puts it on the
SemanticNode
|
java.lang.String |
createClassReportOnGrid(int indexReport,
int clusterlevelReport,
java.util.ArrayList QMReportIntersection)
Creates a 3 fold Report
|
java.lang.String |
createQMComparisonReportonGrid(java.lang.String qualifier,
int Region)
Creates a Comparison report on all Quality Measures(qualifier=null), or on a specific Quality Measure(=Name), on
the given Region, or on the whole grid if the Region is 0
|
Unit[] |
cutArray(int x1,
int x2,
int y1,
int y2)
helper method, cuts a double array from this.units defined by X and Y
|
void |
getClassesfromFatherGrid()
Puts the Fathers Grid Classes in this grid
|
SemanticClass |
getClassfromGrid(int index) |
private java.util.ArrayList[] |
getclassTrail(java.util.ArrayList l)
Goes through the given list and tries to see which classes are connected
|
java.util.HashMap<java.lang.Integer,SemanticClass> |
getClusterLevelClasses()
Gets the specific Classes for the Cluster Area, Used if this.fatherGrid != null & Index = 0
|
static int[] |
getDistance(int[] PointA,
int[] PointB) |
java.util.ArrayList<java.util.ArrayList<SemanticNode>> |
getEmptyNodeTrail(java.util.ArrayList<SemanticNode> EmptyNodes)
Returns a list containing all connect/unconnected parts of the empty units
|
java.util.ArrayList<java.lang.Integer> |
getMaxRegionValue(java.util.ArrayList[] regions,
java.lang.Integer[] wantedRegions)
Returns the MAX Value of the Region (Region values need to be summed and cast into the array at the specific
Region index)
|
private SemanticNode |
getNode(int[] c)
returns the Semantic Node for given coordinates
|
Unit[] |
getNonEmptyUnits()
Returns an array containing nonempty units
FIXME: refactor this, make a method in GrowingLayer , based on
GrowingLayer.getNumberOfNotEmptyUnits() |
int |
getNumberofSharedClasses(boolean clusterarea)
Returns the Number of all shared Classes within this Grid
|
private int[] |
getPartition(int axislength)
Estimates the Areas for the Middle part of the given Axis
|
java.util.ArrayList[] |
getQMIntersectionList(java.lang.String Name1,
java.lang.String Name2,
Unit[] units,
int type)
Returns a 9 field arrayList containing intersection units of QM Name1 & Name2, on units, that were chosen with
the comparing operation type
|
static java.lang.String |
getRegion(int i)
Returns the String Name for the region with index i
FIXME: refactor this with a hashmap or similar |
java.util.ArrayList<SemanticNode>[] |
getRegionOccurance(java.lang.String Name,
int clss)
Return an ArrayList with the SemanticNodes of ocurrances for the given quality measure and class
|
SemanticNode[][] |
getSemanticNodeArray()
returns the semantic node array
|
void |
initializeGridwithClasses(boolean regularGrid)
Creates all the Info needed for Report
|
java.util.ArrayList |
mergeArrayList(java.util.ArrayList l1,
java.util.ArrayList l2) |
java.lang.String |
printQualityMeasureReport(java.lang.String qualifier)
Prints a report on all selected Quality Measures, and adds a picture Frame if a visualization is available
qualifiers is a String array, containing all Names from the quality measures
|
void |
putClassinContainer(SemanticClass cl)
Puts the class in the right HashMap, and checks for wanted EditableProperties
|
void |
setFatherGrid(SemanticInterpreterGrid grid)
Used if the Grid wasn't made from a square Grid, so we use the Class Descriptions from a squared one in
SOMDEscriptionHTLM
|
void |
setSemanticGrid()
Puts this semanticGrid on the QuMContainer, uised or calculations ONLY the masterGrid should be set here, witch
is the one covering the whole Map
|
java.lang.String |
showClassInfos(java.util.ArrayList<java.lang.Integer> classes,
java.lang.Integer type)
Creates a table that shows thew class infos if QMIntersectionClasshMap != Null, we also include a column showing
|
java.lang.String |
simplifyRegionDescription(java.util.ArrayList[] regions)
Returns a simplified Region description (i.e region 3,6,9 lie all on the right side of the grid
FIXME: refactor this |
static Unit[] |
sortNodes(Unit[] units)
Sort the Unit array according to the Coordinates
FIXME: refactor this with some generic java sorting algorithm, implementing a special Comparator first if
needed |
java.lang.String |
testQM(java.lang.String QM_compare,
java.lang.String QM_to,
java.util.ArrayList[] semanticNodes,
int type)
Tests the SemanticNodes found in the ArrayList-array about QM specific properties
|
public int XLength
public int YLength
private int Region
private java.lang.String imgDir
private TestRunResult TestRun
public SemanticNode[][] labels
public Unit[] units
private int[] Gravity
public SemanticInterpreterGrid fatherGrid
private int type
private int GridSize
public static int NUMBER_OF_REGIONS
public java.util.HashMap<java.lang.Integer,SemanticClass>[] SemanticClasses
public java.util.HashMap<java.lang.Integer,SemanticClass> SemanticClassesIndex
public int totalEmptyNodes
private EditableReportProperties EP
private QMContainer qm
public SemanticInterpreterGrid(Unit[] units, TestRunResult testrun, boolean master, int Region, int type, java.lang.String imgDir)
private int[] getPartition(int axislength)
private int[] computeMiddlePartition(int axislength)
private int[] computeSidePartition(int axislength, int type)
private int[] computeAxisPartition(int axislength)
public SemanticNode[][] getSemanticNodeArray()
public void initializeGridwithClasses(boolean regularGrid)
regularGrid
- true if the Grid is regular squaredpublic java.lang.String createClassReportOnGrid(int indexReport, int clusterlevelReport, java.util.ArrayList QMReportIntersection)
indexReport
- = Number of the GridNumber to be analyzedclusterlevelReport
- number of the Clusterlevel to be analyzedQMReportIntersection
- [0] = Name of Quality Measure, [1] = 1 = MAX, 2 = MIN, [3..length] intersectio nunits
of the QM to be analyzedpublic static int[] getDistance(int[] PointA, int[] PointB)
public void createClassReport(int j)
public Unit[] cutArray(int x1, int x2, int y1, int y2)
private SemanticNode getNode(int[] c)
private java.util.ArrayList<java.lang.Integer> compareArrayLists(java.util.ArrayList<java.lang.Integer> a1, java.util.ArrayList<java.lang.Integer> a2)
private java.util.ArrayList[] getclassTrail(java.util.ArrayList l)
public void setFatherGrid(SemanticInterpreterGrid grid)
public java.util.ArrayList<java.util.ArrayList<SemanticNode>> getEmptyNodeTrail(java.util.ArrayList<SemanticNode> EmptyNodes)
public static Unit[] sortNodes(Unit[] units)
Comparator
first if
neededpublic void addClasstoGrid(int j)
j
- classindexpublic int[] concatArrays(int[] a, int[] b)
ArrayUtils.addAll(int[], int[])
insteadpublic static java.lang.String getRegion(int i)
public void putClassinContainer(SemanticClass cl)
public SemanticClass getClassfromGrid(int index)
public java.util.HashMap<java.lang.Integer,SemanticClass> getClusterLevelClasses()
public int getNumberofSharedClasses(boolean clusterarea)
public java.lang.String printQualityMeasureReport(java.lang.String qualifier)
public java.util.ArrayList<SemanticNode>[] getRegionOccurance(java.lang.String Name, int clss)
public java.lang.String simplifyRegionDescription(java.util.ArrayList[] regions)
public java.util.ArrayList<java.lang.Integer> getMaxRegionValue(java.util.ArrayList[] regions, java.lang.Integer[] wantedRegions)
regions
- [9] double/intwantedRegions
- specifies a selectrion of Region, NULL if whole map regions wantedpublic java.lang.String createQMComparisonReportonGrid(java.lang.String qualifier, int Region)
public java.lang.String showClassInfos(java.util.ArrayList<java.lang.Integer> classes, java.lang.Integer type)
classes
- the class indicestype
- 1,2,3,4 reportspublic java.util.ArrayList mergeArrayList(java.util.ArrayList l1, java.util.ArrayList l2)
public java.util.ArrayList[] getQMIntersectionList(java.lang.String Name1, java.lang.String Name2, Unit[] units, int type)
Name1
- QualityMeasure1Name2
- QualityMeasure2units
- Array of units.type
- the type (see QMContainer.getComparedQMRegionOccurances(String, String, Unit[], int)
public void setSemanticGrid()
public java.lang.String testQM(java.lang.String QM_compare, java.lang.String QM_to, java.util.ArrayList[] semanticNodes, int type)
QM_compare
- the QM Identifier that is QM_to is compared to if QM_compare == null, we dont make a
comparison, but just a test of the quality Measuretype
- 1 = MAX, 2 = MINpublic void getClassesfromFatherGrid()
public Unit[] getNonEmptyUnits()
GrowingLayer
, based on
GrowingLayer.getNumberOfNotEmptyUnits()