Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/08 23:14:08 (16 years ago)
Author:
gkronber
Message:

removed 'TypeIds' for functions (also a relic of an old design) (ticket #225)

Location:
trunk/sources/HeuristicLab.Constraints
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Constraints/AllSubOperatorsTypeConstraintView.cs

    r2 r430  
    8787    #endregion
    8888
    89     #region Drag Events   
    90 
     89    #region Drag Events
    9190    private void listView_DragDrop(object sender, DragEventArgs e) {
    9291      if(e.Effect != DragDropEffects.None) {
     
    105104    }
    106105
    107 
    108106    private void listView_DragEnter(object sender, DragEventArgs e) {
    109107      this.FindForm().BringToFront();
     
    117115      }
    118116    }
    119 
    120117
    121118    private void listView_DragOver(object sender, DragEventArgs e) {
  • trunk/sources/HeuristicLab.Constraints/SubOperatorsConstraintAnalyser.cs

    r155 r430  
    9191    private static bool InSet(IOperator op, ICollection<IOperator> set) {
    9292      foreach(IOperator element in set) {
    93         if(element==op ||
    94           ((StringData)element.GetVariable("TypeId").Value).Data ==
    95           ((StringData)op.GetVariable("TypeId").Value).Data) {
     93        if(element == op)
    9694          return true;
    97         }
    9895      }
    99 
    10096      return false;
    10197    }
     
    132128        }
    133129      }
    134      
     130
    135131      public override void Visit(OrConstraint constraint) {
    136132        base.Visit(constraint);
  • trunk/sources/HeuristicLab.Constraints/SubOperatorsTypeConstraint.cs

    r2 r430  
    5555      // check if already in the list of allowed functions
    5656      foreach(IOperator existingOp in subOperators) {
    57         if (IsOperatorTypeEqual(existingOp, op)) {
     57        if(existingOp == op) {
    5858          return;
    5959        }
     
    6666      IOperator matchingOperator = null;
    6767      foreach(IOperator existingOp in subOperators) {
    68         if(IsOperatorTypeEqual(existingOp, op)) {
     68        if(existingOp == op) {
    6969          matchingOperator = existingOp;
    7070          break;
     
    7272      }
    7373
    74       if (matchingOperator != null) {
     74      if(matchingOperator != null) {
    7575        subOperators.Remove(matchingOperator);
    7676      }
     
    7979    public override bool Check(IItem data) {
    8080      IOperator op = data as IOperator;
    81       if (data == null) return false;
     81      if(data == null) return false;
    8282
    8383      if(op.SubOperators.Count <= subOperatorIndex.Data) {
    8484        return false;
    8585      }
    86      
    87       return subOperators.Exists(delegate(IOperator curOp) { return IsOperatorTypeEqual(curOp, op.SubOperators[subOperatorIndex.Data]); });
     86
     87      return subOperators.Exists(delegate(IOperator curOp) { return curOp == op.SubOperators[subOperatorIndex.Data]; });
    8888    }
    8989
     
    108108
    109109    #region persistence
    110     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
     110    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    111111      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    112112      XmlNode indexNode = PersistenceManager.Persist("SubOperatorIndex", subOperatorIndex, document, persistedObjects);
     
    121121    }
    122122
    123     public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {
     123    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    124124      base.Populate(node, restoredObjects);
    125125      subOperatorIndex = (IntData)PersistenceManager.Restore(node.SelectSingleNode("SubOperatorIndex"), restoredObjects);
     
    131131    #endregion persistence
    132132
    133 
    134     private bool IsOperatorTypeEqual(IOperator f, IOperator g) {
    135       return ((StringData)f.GetVariable("TypeId").Value).Data == ((StringData)g.GetVariable("TypeId").Value).Data;
    136     }
    137133  }
    138134}
Note: See TracChangeset for help on using the changeset viewer.