|
@@ -64,9 +64,15 @@ public class BlockCalc implements AlgorithmStep {
|
|
|
if( current.getAlignedTo() == current )
|
|
|
{
|
|
|
LayeredGraphNode u = incommingEdges.get( m - 1 ).getSources().get( 0 );
|
|
|
- // TODO detect conflicts
|
|
|
- if( r < graph.getContainedLayers().get( layerIndex - 1 ).indexOf( u ) )
|
|
|
+ ArrayList<LayeredGraphEdge> conflicts = incommingEdges.get( m - 1 ).calcConflictedEdges();
|
|
|
+ if( !incommingEdges.get( m - 1 ).isConflicted() && r < graph.getContainedLayers().get( layerIndex - 1 ).indexOf( u ) )
|
|
|
{
|
|
|
+ ArrayList< Boolean > oldConflicts = new ArrayList<>();
|
|
|
+ for( LayeredGraphEdge e : conflicts )
|
|
|
+ {
|
|
|
+ oldConflicts.add( e.isConflicted() );
|
|
|
+ e.setConflicted( true );
|
|
|
+ }
|
|
|
LayeredGraphNode oldAlignU = u.getAlignedTo();
|
|
|
Color oldColorCurrent = current.getColor();
|
|
|
LayeredGraphNode oldRootCurrent = current.getRoot();
|
|
@@ -80,6 +86,8 @@ public class BlockCalc implements AlgorithmStep {
|
|
|
int oldStep = step++;
|
|
|
backwards.add( 0, () -> {
|
|
|
System.out.println( "Stepping Backwards... (Step " + oldStep + ")" );
|
|
|
+ for( int i = 0; i < conflicts.size(); i++ )
|
|
|
+ conflicts.get( i ).setConflicted( oldConflicts.get( i ) );
|
|
|
u.setAlignTo( oldAlignU );
|
|
|
current.setColor( oldColorCurrent );
|
|
|
current.setRoot( oldRootCurrent );
|