diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index 1c1275b5..9e12307c 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -1589,7 +1589,9 @@ namespace Anabatic { bool AutoSegment::reduce () { + if (isReduced()) return false; if (not canReduce()) return false; + cdebug_log(159,0) << "AutoSegment::reduce():" << this << endl; AutoContact* source = getAutoSource(); AutoContact* target = getAutoTarget(); @@ -1604,9 +1606,6 @@ namespace Anabatic { perpandicular->incReduceds(); } - // if (not source->isTerminal()) source->getPerpandicular( this )->incReduceds(); - // if (not target->isTerminal()) target->getPerpandicular( this )->incReduceds(); - return true; } @@ -1627,19 +1626,20 @@ namespace Anabatic { bool AutoSegment::raise () { if (not (_flags & SegIsReduced)) return false; + cdebug_log(159,0) << "AutoSegment::raise():" << this << endl; AutoContact* source = getAutoSource(); AutoContact* target = getAutoTarget(); _flags &= ~SegIsReduced; - //if (not source->isTerminal()) source->getPerpandicular( this )->decReduceds(); - //if (not target->isTerminal()) target->getPerpandicular( this )->decReduceds(); for ( AutoSegment* perpandicular : source->getAutoSegments() ) { if (perpandicular == this) continue; + cdebug_log(159,0) << "dec PP:" << perpandicular << endl; perpandicular->decReduceds(); } for ( AutoSegment* perpandicular : target->getAutoSegments() ) { if (perpandicular == this) continue; + cdebug_log(159,0) << "dec PP:" << perpandicular << endl; perpandicular->decReduceds(); } diff --git a/katana/src/RoutingEventQueue.cpp b/katana/src/RoutingEventQueue.cpp index 849234f5..ca208c3c 100644 --- a/katana/src/RoutingEventQueue.cpp +++ b/katana/src/RoutingEventQueue.cpp @@ -155,7 +155,7 @@ namespace Katana { multiset::iterator ievent = _events.find(event); size_t count = _events.count(event); if (count > 1) { - cerr << Bug("RoutingEventQueue::repush(): %d events matches key %p.",count,event) << endl; + cerr << Bug( "RoutingEventQueue::repush(): %d events matches key %p.", count, event ) << endl; #if defined(CHECK_ROUTINGEVENT_QUEUE) _keyCheck (); #endif diff --git a/katana/src/SegmentFsm.cpp b/katana/src/SegmentFsm.cpp index 7473ba93..08a12762 100644 --- a/katana/src/SegmentFsm.cpp +++ b/katana/src/SegmentFsm.cpp @@ -375,7 +375,8 @@ namespace Katana { cdebug_log(159,1) << "* Riping // " << _segment << endl; } - if (_segment->isFixed()) { DebugSession::close(); return true; } + if (_segment->isFixed ()) { DebugSession::close(); return true; } + //if (_segment->isReduced()) { DebugSession::close(); return true; } DataNegociate* data = _segment->getDataNegociate(); if (data == NULL) { diff --git a/katana/src/Session.cpp b/katana/src/Session.cpp index 908882fc..3e037011 100644 --- a/katana/src/Session.cpp +++ b/katana/src/Session.cpp @@ -318,18 +318,18 @@ namespace Katana { // Looking for reduced/raised segments. for ( size_t i=0 ; icanReduce()) { - revalidateds[i]->reduce(); - TrackElement* trackSegment = lookup( revalidateds[i] ); - if (trackSegment and trackSegment->getTrack()) _addRemoveEvent( trackSegment ); - cdebug_log(159,0) << "Session: reduce:" << revalidateds[i] << endl; - } if (revalidateds[i]->mustRaise()) { cdebug_log(159,0) << "Session: raise:" << revalidateds[i] << endl; revalidateds[i]->raise(); TrackElement* trackSegment = lookup( revalidateds[i] ); if (trackSegment) trackSegment->reschedule( 0 ); } + if (revalidateds[i]->canReduce()) { + revalidateds[i]->reduce(); + TrackElement* trackSegment = lookup( revalidateds[i] ); + if (trackSegment and trackSegment->getTrack()) _addRemoveEvent( trackSegment ); + cdebug_log(159,0) << "Session: reduce:" << revalidateds[i] << endl; + } } // for ( TrackElement* trackSegment : _indirectInvalids ) {