|
@@ -213,9 +213,9 @@ public class BlockCalc implements AlgorithmStage {
|
|
|
else
|
|
|
layerBefore = m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", MemoryType.LOCAL ).get( m.<Integer>read( "i", MemoryType.LOCAL ) + 1 );
|
|
|
int posU = layerBefore.indexOf( m.<ArrayList<LayeredGraphNode>>read( "neighbors", MemoryType.LOCAL ).get( m.read( "m", MemoryType.LOCAL ) ) );
|
|
|
- return e.isConflicted( LayoutType.fromString( m.read( "layout", MemoryType.LOCAL ) ) ) &&
|
|
|
- ( ( m.<Integer>read( "r", MemoryType.LOCAL ) < posU && m.<String>read( "layout", MemoryType.LOCAL ).contains( "RIGHT" ) ) ||
|
|
|
- ( m.<Integer>read( "r", MemoryType.LOCAL ) > posU && m.<String>read( "layout", MemoryType.LOCAL ).contains( "LEFT" ) ) );
|
|
|
+ return !e.isConflicted( LayoutType.fromString( m.read( "layout", MemoryType.LOCAL ) ) ) &&
|
|
|
+ ( ( m.<Double>read( "r", MemoryType.LOCAL ) < posU && m.<String>read( "layout", MemoryType.LOCAL ).contains( "RIGHT" ) ) ||
|
|
|
+ ( m.<Double>read( "r", MemoryType.LOCAL ) > posU && m.<String>read( "layout", MemoryType.LOCAL ).contains( "LEFT" ) ) );
|
|
|
}
|
|
|
});
|
|
|
ifAlign.add( ifMarked );
|
|
@@ -257,16 +257,16 @@ public class BlockCalc implements AlgorithmStage {
|
|
|
return new ControlFlow( ControlFlow.STEP_OVER );
|
|
|
}
|
|
|
}) );
|
|
|
- ifMarked.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "r = pos( neighbors[m] );", vars ), tree, new SetVariable<Integer>( "r" ) {
|
|
|
+ ifMarked.add( new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "r = pos( neighbors[m] );", vars ), tree, new SetVariable<Double>( "r" ) {
|
|
|
@Override
|
|
|
- protected Integer value(ReadOnlyMemory m) {
|
|
|
+ protected Double value(ReadOnlyMemory m) {
|
|
|
ArrayList<LayeredGraphNode> layerBefore;
|
|
|
if( m.<String>read( "layout", MemoryType.LOCAL ).contains( "DOWN" ) )
|
|
|
layerBefore = m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", MemoryType.LOCAL ).get( m.<Integer>read( "i", MemoryType.LOCAL ) - 1 );
|
|
|
else
|
|
|
layerBefore = m.<ArrayList<ArrayList<LayeredGraphNode>>>read( "L", MemoryType.LOCAL ).get( m.<Integer>read( "i", MemoryType.LOCAL ) + 1 );
|
|
|
LayeredGraphNode u = m.<ArrayList<LayeredGraphNode>>read( "neighbors", MemoryType.LOCAL ).get( m.read( "m", MemoryType.LOCAL ) );
|
|
|
- return layerBefore.indexOf( u );
|
|
|
+ return (double)layerBefore.indexOf( u );
|
|
|
}
|
|
|
}) );
|
|
|
return root;
|