Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/20/08 21:44:59 (16 years ago)
Author:
gkronber
Message:

fixed two loose ends from r525 (#263):

  • update all SubOperatorTypeConstraints when an operator is removed from the operator library
  • invalidate the cached list of allowed sub functions in FunctionBase when one of the constraints is changed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/GPOperatorGroup.cs

    r468 r529  
    184184        if(c is SubOperatorTypeConstraint || c is AllSubOperatorsTypeConstraint) c.Changed -= new EventHandler(UpdateTreeBounds);
    185185      }
     186
     187      // remove the operator from the allowed sub-functions of the remaining operators
     188      foreach(IOperator o in Operators) {
     189        if(o != op) {
     190          foreach(IConstraint c in o.Constraints) {
     191            if(c is SubOperatorTypeConstraint) {
     192              ((SubOperatorTypeConstraint)c).RemoveOperator(op);
     193            } else if(c is AllSubOperatorsTypeConstraint) {
     194              ((AllSubOperatorsTypeConstraint)c).RemoveOperator(op);
     195            }
     196          }
     197        }
     198      }
    186199      OnOperatorRemoved(op);
    187200    }
Note: See TracChangeset for help on using the changeset viewer.