Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PtrMan committed Nov 21, 2014
1 parent bcbc6dd commit dd90367
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 128 deletions.
52 changes: 0 additions & 52 deletions DecoratedCausalGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ public static class Node
{
public static class Anotation
{
/*
public class OutgoingEdge
{
public boolean isRed;
public ArrayList<Integer> outgoingEdgeBounced = new ArrayList<Integer>();
// invariant: elements in that list are not allready in the output
// elements get removed as elements are taken out
public boolean areRemainingOutgoingEdgeBounced()
{
return outgoingEdgeBounced.size() > 0;
}
}
public OutgoingEdge[] outgoingEdges;
*/

public boolean isOrWasInWorkingSet; // is/was this node in the working set for ttraversal?

// flags used to indicate that the node of the incomming edge must occur before that node
Expand Down Expand Up @@ -57,38 +39,6 @@ public boolean isInOutput()
return outputIndex != -1;
}

/*
public boolean existAnyRemainingOutgoingEdgeBounced()
{
int i;
for( i = 0; i < outgoingEdges.length; i++ )
{
if( outgoingEdges[i].areRemainingOutgoingEdgeBounced() )
{
return true;
}
}
return false;
}
// INVARIANT< only callable if existAnyRemainingOutgoingEdgeBounced() returns true, else it goes into an infinite loop >
public OutgoingEdge getRandomOutgoingEdgeWithRemainingOutgoingEdgeBounced(Random random)
{
for(;;)
{
int currentOutgoingEdgeIndex;
currentOutgoingEdgeIndex = random.nextInt(outgoingEdges.length);
if( outgoingEdges[currentOutgoingEdgeIndex].areRemainingOutgoingEdgeBounced() )
{
return outgoingEdges[currentOutgoingEdgeIndex];
}
}
}*/

public Anotation clone()
{
Anotation cloned;
Expand Down Expand Up @@ -135,8 +85,6 @@ public Node clone()

public ArrayList<Node> nodes = new ArrayList<Node>();

//public int[] rootIndices;

public void resetAnnotation()
{
int i;
Expand Down
76 changes: 0 additions & 76 deletions TrackbackGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,84 +133,8 @@ static public ArrayList<Integer> generate(Random random, DecoratedCausalGraph ca
assert result.size() == causalGraph.nodes.size();

return result;

/*
bounceFrom(rootIndicesIndex, causalGraph);
int currentNodeIndex = rootIndicesIndex;
boolean existsAnyRemainingOutgoingEdgeBounced = causalGraph.nodes.get(currentNodeIndex).anotation.existAnyRemainingOutgoingEdgeBounced();
if( !existsAnyRemainingOutgoingEdgeBounced )
{
// TODO< add following node of red egde and continue algorithm >
}
else
{
DecoratedCausalGraph.Node.Anotation.OutgoingEdge currentOutgoingEdge;
currentOutgoingEdge = causalGraph.nodes.get(currentNodeIndex).anotation.getRandomOutgoingEdgeWithRemainingOutgoingEdgeBounced(random);
// choose and remove random bounced edge and add it to the result
// TODO< >
// TODO< add the node to the traversingNodes >
}
*/

// TODO

//return result;
}

// TODO< what do we about the red connection? >

/**
*
* goes to all outgoing nodes and links in bounced connections
*
*
*/
/*
static private void bounceFrom(int nodeIndex, DecoratedCausalGraph causalGraph) {
DecoratedCausalGraph.Node selectedNode;
selectedNode = causalGraph.nodes.get(nodeIndex);
**
*
* iterate trough each outgoing connection of this node and anotate the outgoing path with the nodes which should follow before the red nodes get inserted
*
*
for( int outgoingEdgeIndex = 0; outgoingEdgeIndex < selectedNode.outgoingEdgeElementIndices.length; outgoingEdgeIndex++ )
{
DecoratedCausalGraph.Node outgoingNode;
int iterationOutgoingIndex;
iterationOutgoingIndex = selectedNode.outgoingEdgeElementIndices[outgoingEdgeIndex];
outgoingNode = causalGraph.nodes.get(iterationOutgoingIndex);
outgoingNode.anotation.outgoingEdges[outgoingEdgeIndex].isRed = true;
for( int iterationBouncedIndex : outgoingNode.incommingEdgeElementIndices )
{
if( iterationBouncedIndex == iterationOutgoingIndex )
{
// we don't want to include the actual incomming path in our bounced indices for that node
continue;
}
if( causalGraph.nodes.get(iterationBouncedIndex).anotation.inOutput )
{
// we are not interested in bounced noes which are allready in the output
continue;
}
selectedNode.anotation.outgoingEdges[outgoingEdgeIndex].outgoingEdgeBounced.add(new Integer(iterationBouncedIndex));
}
}
}*/

static private int getIndexOfElementInArray(int[] array, int element)
{
int i;
Expand Down

0 comments on commit dd90367

Please sign in to comment.