AttributeLogGraph extends WeightedAttributeGraph { public void buildSubGraphs(IndexableAttribute sortedAttribute, MeasureType newWeightType, MeasureAggregation newWeightAggregation, boolean newNodeInverted, boolean newArcInverted) { System.out.println("Total Number of nodes: " + this.getNodes().size()); System.out.println("Total Number of arcs: " + this.getArcs().size()); long timer = System.currentTimeMillis(); boolean buildSubgraphs = false; boolean sortNodesArcs = false; if (subGraphs.isEmpty()) { sortNodesArcs = true; } else if (subGraphsSortedAttribute != sortedAttribute) { sortNodesArcs = true; } else if (weightType != newWeightType || weightAggregation != newWeightAggregation) { nodeWeightsForGraphStructure = getNodeWeightMap(weightType, weightAggregation); arcWeightsForGraphStructure = getArcWeightMap(weightType, weightAggregation); sortNodesArcs = true; } else if (nodeInverted != newNodeInverted || arcInverted != newArcInverted) { buildSubgraphs = true; } subGraphsSortedAttribute = sortedAttribute; weightType = newWeightType; weightAggregation = newWeightAggregation; nodeInverted = newNodeInverted; arcInverted = newArcInverted; if (!sortNodesArcs && !buildSubgraphs) { return; } if (sortNodesArcs) { nodeWeightsForGraphStructure = getNodeWeightMap(weightType, weightAggregation); arcWeightsForGraphStructure = getArcWeightMap(weightType, weightAggregation); sortNodesAndArcs(); } MutableList<MutableIntList> removableBins = buildRemovaleNodesByEvenBinning(); subGraphs.clear(); NodeBasedGraph nodeBasedGraph = new NodeBasedGraph(this, getNodeBitMask(), getArcBitMask()); subGraphs.add(nodeBasedGraph); for (IntList b : removableBins) { nodeBasedGraph = new NodeBasedGraph(this, nodeBasedGraph.cloneNodeBitMask(), nodeBasedGraph.cloneArcBitMask()); for (int node : b.toArray()) { nodeBasedGraph.markRemoveNode(node); } subGraphs.add(nodeBasedGraph); } NodeBasedGraph preGraph = null; for (FilteredGraph nodeGraph: subGraphs.toReversed()) { ((NodeBasedGraph)nodeGraph).buildSubGraphs(preGraph, arcInverted); preGraph = (NodeBasedGraph)nodeGraph; } System.out.println("Build all graphs: " + (System.currentTimeMillis() - timer) + " ms."); } AttributeLogGraph(AttributeLog attLog); @Override void clear(); void addTraceGraph(AttributeTraceGraph traceGraph); void finalUpdate(); double getNodeWeight(String nodeName, MeasureType type, MeasureAggregation aggregation); @Override double getNodeWeight(int node, MeasureType type, MeasureAggregation aggregation); @Override double getArcWeight(int arc, MeasureType type, MeasureAggregation aggregation); double getArcStructuralWeight(int arc); double getNodeStructuralWeight(int node); void buildSubGraphs(IndexableAttribute sortedAttribute, MeasureType newWeightType, MeasureAggregation newWeightAggregation, 
            boolean newNodeInverted, boolean newArcInverted); ListIterable<FilteredGraph> getSubGraphs(); FilteredGraph filter(double nodeThreshold, double arcThreshold); IntList getSortedNodes(); IntList getSortedArcs();  }
@Test public void test_Exception() { ALog log = new ALog(readLogWithOneTraceAndCompleteEvents()); AttributeLog attLog = new AttributeLog(log, log.getAttributeStore().getStandardEventConceptName()); AttributeLogGraph graph = attLog.getGraphView(); graph.buildSubGraphs(attLog.getAttribute(), MeasureType.FREQUENCY, MeasureAggregation.TOTAL, false, false); boolean addResult = graph.addNode(100); Assert.assertEquals(false, addResult); addResult = graph.addNode(1); Assert.assertEquals(false, addResult); int arc1 = graph.getArc(0, 2); Assert.assertNotEquals(-1, arc1); int arc2 = graph.getArc(100, 0); Assert.assertEquals(-1, arc2); }