Changeset 123
- Timestamp:
- 04/15/08 15:57:41 (17 years ago)
- Location:
- branches/XmlTextReaderBranch
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/XmlTextReaderBranch/HeuristicLab.Constraints/AllSubOperatorsTypeConstraint.cs
r121 r123 98 98 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 99 99 base.Populate(reader, restoredObjects); 100 reader.Read(); 100 101 groupConstraint = (SubOperatorTypeConstraint)PersistenceManager.Restore(reader, "SubOperatorsGroupConstraint", restoredObjects); 102 reader.Read(); 101 103 } 102 104 #endregion persistence -
branches/XmlTextReaderBranch/HeuristicLab.Constraints/AndConstraint.cs
r121 r123 87 87 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 88 88 base.Populate(reader, restoredObjects); 89 reader.Read(); 89 90 clauses = (ItemList<IConstraint>)PersistenceManager.Restore(reader, "Clauses", restoredObjects); 91 reader.Read(); 90 92 } 91 93 #endregion persistence -
branches/XmlTextReaderBranch/HeuristicLab.Constraints/NotConstraint.cs
r121 r123 81 81 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 82 82 base.Populate(reader, restoredObjects); 83 reader.Read(); 83 84 subConstraint = (ConstraintBase)PersistenceManager.Restore(reader, "SubConstraint", restoredObjects); 85 reader.Read(); 84 86 } 85 87 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Constraints/NumberOfSubOperatorsConstraint.cs
r122 r123 94 94 //} 95 95 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 96 base.Populate(reader, restoredObjects); 97 reader.Read(); 96 98 minOperators = (IntData)PersistenceManager.Restore(reader, "min", restoredObjects); 99 reader.Read(); 97 100 maxOperators = (IntData)PersistenceManager.Restore(reader, "max", restoredObjects); 98 base.Populate(reader, restoredObjects);101 reader.Read(); 99 102 } 100 103 #endregion persistence -
branches/XmlTextReaderBranch/HeuristicLab.Constraints/OrConstraint.cs
r121 r123 88 88 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 89 89 base.Populate(reader, restoredObjects); 90 reader.Read(); 90 91 clauses = (ItemList<IConstraint>)PersistenceManager.Restore(reader, "Clauses", restoredObjects); 92 reader.Read(); 91 93 } 92 94 #endregion persistence -
branches/XmlTextReaderBranch/HeuristicLab.Constraints/SubOperatorsTypeConstraint.cs
r122 r123 131 131 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 132 132 base.Populate(reader, restoredObjects); 133 reader.Read(); 133 134 subOperatorIndex = (IntData)PersistenceManager.Restore(reader, "SubOperatorIndex", restoredObjects); 135 reader.Read(); 134 136 subOperators = new List<IOperator>(); 135 reader.ReadToDescendant("AllowedSubOperators"); 136 while(reader.IsStartElement()) 137 subOperators.Add((IOperator)PersistenceManager.Restore(reader, restoredObjects)); 138 reader.ReadEndElement(); 137 if(reader.Name !="AllowedSubOperators") throw new XmlException("Expected: \"AllowedSubOperators\", found: \""+reader.Name+"\""); 138 if(!reader.IsEmptyElement) { 139 reader.Read(); 140 while(reader.IsStartElement()) { 141 subOperators.Add((IOperator)PersistenceManager.Restore(reader, restoredObjects)); 142 reader.Skip(); 143 } 144 reader.ReadEndElement(); 145 } else { 146 reader.Read(); 147 } 139 148 } 140 149 #endregion persistence -
branches/XmlTextReaderBranch/HeuristicLab.Constraints/VariableComparisonConstraint.cs
r121 r123 125 125 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 126 126 base.Populate(reader, restoredObjects); 127 reader.Read(); 127 128 leftVarName = (StringData)PersistenceManager.Restore(reader, "LeftVarName", restoredObjects); 129 reader.Skip(); 128 130 rightVarName = (StringData)PersistenceManager.Restore(reader, "RightVarName", restoredObjects); 131 reader.Skip(); 129 132 comparer = (IntData)PersistenceManager.Restore(reader, "Comparer", restoredObjects); 133 reader.Read(); 130 134 } 131 135 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Core/CompositeOperation.cs
r122 r123 84 84 base.Populate(reader, restoredObjects); 85 85 86 reader.ReadToDescendant("Operations"); 87 while(reader.IsStartElement()) 88 AddOperation((IOperation)PersistenceManager.Restore(reader, restoredObjects)); 89 reader.ReadEndElement(); 86 if(reader.Name != "Operations") throw new XmlException("Expected: \"Operations\", found: \""+reader.Name+"\""); 87 if(!reader.IsEmptyElement) { 88 reader.Read(); 89 while(reader.IsStartElement()) { 90 AddOperation((IOperation)PersistenceManager.Restore(reader, restoredObjects)); 91 reader.Skip(); 92 } 93 reader.ReadEndElement(); 94 } else { 95 reader.Read(); 96 } 90 97 } 91 98 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Core/ConstrainedItemBase.cs
r122 r123 111 111 if(reader.Name == "Constraints") { 112 112 myConstraints.Clear(); 113 while(reader.IsStartElement()) 113 reader.Read(); 114 while(reader.IsStartElement()) { 114 115 AddConstraint((IConstraint)PersistenceManager.Restore(reader, restoredObjects)); 116 reader.Skip(); 117 } 115 118 reader.ReadEndElement(); 116 119 } -
branches/XmlTextReaderBranch/HeuristicLab.Core/OperatorGroup.cs
r122 r123 111 111 myName = reader["Name"]; 112 112 base.Populate(reader, restoredObjects); 113 114 reader.ReadToDescendant("SubGroups"); 115 while(reader.IsStartElement()) 116 AddSubGroup((IOperatorGroup)PersistenceManager.Restore(reader, restoredObjects)); 117 reader.ReadEndElement(); 118 reader.ReadToDescendant("Operators"); 119 while(reader.IsStartElement()) 120 AddOperator((IOperator)PersistenceManager.Restore(reader, restoredObjects)); 121 reader.ReadEndElement(); 113 reader.Read(); 114 if(reader.Name != "SubGroups") throw new XmlException("Expected: \"SubGroups\", found: \"" + reader.Name + "\""); 115 if(!reader.IsEmptyElement) { 116 reader.Read(); 117 while(reader.IsStartElement()) { 118 AddSubGroup((IOperatorGroup)PersistenceManager.Restore(reader, restoredObjects)); 119 reader.Skip(); 120 } 121 reader.ReadEndElement(); 122 } else { 123 reader.Read(); 124 } 125 if(reader.Name != "Operators") throw new XmlException("Expected: \"Operators\", found: \"" + reader.Name + "\""); 126 if(!reader.IsEmptyElement) { 127 reader.Read(); 128 while(reader.IsStartElement()) { 129 AddOperator((IOperator)PersistenceManager.Restore(reader, restoredObjects)); 130 reader.Skip(); 131 } 132 reader.ReadEndElement(); 133 } else { 134 reader.Read(); 135 } 122 136 } 123 137 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Core/OperatorLibrary.cs
r121 r123 58 58 public override void Populate(XmlReader reader, IDictionary<Guid,IStorable> restoredObjects) { 59 59 base.Populate(reader, restoredObjects); 60 reader.Read(); 60 61 myGroup = (IOperatorGroup)PersistenceManager.Restore(reader, "OperatorGroup", restoredObjects); 62 reader.Read(); 61 63 } 62 64 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Data/ConstrainedDoubleData.cs
r121 r123 68 68 base.Populate(reader, restoredObjects); 69 69 base.Data = (DoubleData)PersistenceManager.Restore(reader, "Value", restoredObjects); 70 reader.Read(); 70 71 } 71 72 -
branches/XmlTextReaderBranch/HeuristicLab.Data/ConstrainedIntData.cs
r121 r123 68 68 base.Populate(reader, restoredObjects); 69 69 base.Data = (IntData)PersistenceManager.Restore(reader, "Value", restoredObjects); 70 reader.Read(); 70 71 } 71 72 -
branches/XmlTextReaderBranch/HeuristicLab.Data/ConstrainedItemList.cs
r122 r123 77 77 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 78 78 base.Populate(reader, restoredObjects); 79 reader.Read();80 79 if(reader.Name!="ListItems") throw new XmlException("Expected: \"ListItems\", found: \""+reader.Name+"\""); 81 80 suspendConstraintCheck = bool.Parse(reader["SuspendConstraintCheck"]); -
branches/XmlTextReaderBranch/HeuristicLab.Data/DoubleArrayData.cs
r121 r123 45 45 } 46 46 47 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {47 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 48 48 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 49 49 node.InnerText = ToString(CultureInfo.InvariantCulture.NumberFormat); -
branches/XmlTextReaderBranch/HeuristicLab.Data/ItemList_T.cs
r122 r123 63 63 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 64 64 base.Populate(reader, restoredObjects); 65 reader.Read(); 66 while(reader.IsStartElement()) { 67 list.Add((T)PersistenceManager.Restore(reader, restoredObjects)); 68 reader.Skip(); 69 } 70 reader.ReadEndElement(); 65 if(!reader.IsEmptyElement) { 66 reader.Read(); 67 while(reader.IsStartElement()) { 68 list.Add((T)PersistenceManager.Restore(reader, restoredObjects)); 69 reader.Skip(); 70 } 71 reader.ReadEndElement(); 72 } else { 73 reader.Read(); 74 } 71 75 } 72 76 -
branches/XmlTextReaderBranch/HeuristicLab.ES/ES.cs
r122 r123 612 612 //} 613 613 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 614 base.Populate(reader, restoredObjects); 615 reader.Read(); 614 616 myEngine = (IEngine)PersistenceManager.Restore(reader, "Engine", restoredObjects); 615 base.Populate(reader, restoredObjects);616 617 SetReferences(); 618 reader.Read(); 617 619 } 618 620 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Functions/Constant.cs
r121 r123 80 80 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 81 81 base.Populate(reader, restoredObjects); 82 83 82 value = GetVariable("Value"); 84 83 } -
branches/XmlTextReaderBranch/HeuristicLab.Functions/FunctionBase.cs
r122 r123 329 329 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 330 330 base.Populate(reader, restoredObjects); 331 if(reader.IsStartElement() && reader.Name == "FunctionTemplate") { 331 if(reader.Name == "FunctionTemplate") { 332 reader.Read(); 332 333 metaObject = (FunctionBase)PersistenceManager.Restore(reader, restoredObjects); 334 reader.Read(); 335 reader.ReadEndElement(); 333 336 } else { 334 337 metaObject = this; … … 337 340 338 341 // load local variables 339 reader.ReadToDescendant("LocalVariables");342 if(reader.Name!="LocalVariables") throw new XmlException("Expected: \"LocalVariables\", found: \""+reader.Name+"\""); 340 343 // remove the variables that have been added in a constructor 341 344 variables.Clear(); 342 345 // load the persisted variables 343 while(reader.IsStartElement()) 344 variables.Add((IVariable)PersistenceManager.Restore(reader, restoredObjects)); 345 reader.ReadEndElement(); 346 if(!reader.IsEmptyElement) { 347 reader.Read(); 348 while(reader.IsStartElement()) { 349 variables.Add((IVariable)PersistenceManager.Restore(reader, restoredObjects)); 350 reader.Skip(); 351 } 352 reader.ReadEndElement(); 353 } else { 354 reader.Read(); 355 } 346 356 } 347 357 -
branches/XmlTextReaderBranch/HeuristicLab.Functions/Variable.cs
r121 r123 104 104 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 105 105 base.Populate(reader, restoredObjects); 106 107 106 variable = (ConstrainedIntData)GetVariable("Variable").Value; 108 107 weight = (ConstrainedDoubleData)GetVariable("Weight").Value; -
branches/XmlTextReaderBranch/HeuristicLab.Grid/ProcessingEngine.cs
r121 r123 58 58 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 59 59 base.Populate(reader, restoredObjects); 60 reader.Read(); 60 61 initialOperation = (AtomicOperation)PersistenceManager.Restore(reader, "InitialOperation", restoredObjects); 62 reader.Read(); 61 63 } 62 64 -
branches/XmlTextReaderBranch/HeuristicLab.Logging/Linechart.cs
r121 r123 96 96 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 97 97 base.Populate(reader, restoredObjects); 98 reader.Read(); 98 99 myNumberOfLines = (IntData)PersistenceManager.Restore(reader, "NumberOfLines", restoredObjects); 100 reader.Skip(); 99 101 myValues = (ItemList)PersistenceManager.Restore(reader, "Values", restoredObjects); 102 reader.Read(); 100 103 } 101 104 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Logging/Log.cs
r121 r123 70 70 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 71 71 base.Populate(reader, restoredObjects); 72 reader.Read(); 72 73 myItems = (ItemList)PersistenceManager.Restore(reader, "Items", restoredObjects); 74 reader.Read(); 73 75 } 74 76 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Operators.Programmable/ProgrammableOperator.cs
r122 r123 211 211 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 212 212 base.Populate(reader, restoredObjects); 213 reader.ReadToDescendant("Description"); 214 myDescription = reader.ReadString(); 215 reader.ReadEndElement(); 216 reader.ReadToDescendant("Code"); 217 myCode = reader.ReadString(); 218 reader.ReadEndElement(); 213 myDescription = reader.ReadElementString("Description"); 214 myCode = reader.ReadElementString("Code"); 219 215 } 220 216 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Operators/CombinedOperator.cs
r122 r123 106 106 myDescription = reader.ReadElementString("Description"); 107 107 myOperatorGraph = (IOperatorGraph)PersistenceManager.Restore(reader, "OperatorGraph", restoredObjects); 108 reader.Read(); 108 109 } 109 110 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Random/MersenneTwister.cs
r122 r123 142 142 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 143 143 base.Populate(reader, restoredObjects); 144 145 reader.ReadToDescendant("State"); 146 string stateString = reader.ReadString(); 147 reader.ReadEndElement(); 144 reader.Read(); 145 string stateString = reader.ReadElementString("State"); 148 146 string[] tokens = stateString.Split(';'); 149 147 for(int i = 0; i < tokens.Length; i++) 150 148 state[i] = uint.Parse(tokens[i]); 151 reader.ReadToDescendant("P"); 152 p = int.Parse(reader.ReadString()); 153 reader.ReadEndElement(); 154 reader.ReadToDescendant("Init"); 155 init = bool.Parse(reader.ReadString()); 156 reader.ReadEndElement(); 149 p = int.Parse(reader.ReadElementString("P")); 150 init = bool.Parse(reader.ReadElementString("Init")); 157 151 } 158 152 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Random/NormalDistributedRandom.cs
r122 r123 538 538 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 539 539 base.Populate(reader, restoredObjects); 540 reader.ReadToDescendant("Mu"); 541 mu = double.Parse(reader.ReadString()); 542 reader.ReadEndElement(); 543 reader.ReadToDescendant("Sigma"); 544 sigma = double.Parse(reader.ReadString()); 545 reader.ReadEndElement(); 540 mu = double.Parse(reader.ReadElementString("Mu")); 541 sigma = double.Parse(reader.ReadElementString("Sigma")); 546 542 uniform = (IRandom)PersistenceManager.Restore(reader, "UniformRandom", restoredObjects); 543 reader.Read(); 547 544 } 548 545 -
branches/XmlTextReaderBranch/HeuristicLab.Routing.TSP/TSPTour.cs
r121 r123 85 85 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 86 86 base.Populate(reader, restoredObjects); 87 reader.Read(); 87 88 myCoordinates = (DoubleMatrixData)PersistenceManager.Restore(reader, "Coordinates", restoredObjects); 89 reader.Skip(); 88 90 myTour = (Permutation.Permutation)PersistenceManager.Restore(reader, "Tour", restoredObjects); 91 reader.Read(); 89 92 } 90 93 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.SGA/SGA.cs
r121 r123 518 518 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 519 519 base.Populate(reader, restoredObjects); 520 reader.Read(); 520 521 myEngine = (IEngine)PersistenceManager.Restore(reader, "Engine", restoredObjects); 521 522 SetReferences(); 523 reader.Read(); 522 524 } 523 525 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Scheduling.JSSP/JSSPInjector.cs
r121 r123 96 96 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 97 97 base.Populate(reader, restoredObjects); 98 reader.Read(); 98 99 operations = (ItemList)PersistenceManager.Restore(reader, "Operations", restoredObjects); 100 reader.Skip(); 99 101 jobs = (IntData)PersistenceManager.Restore(reader, "Jobs", restoredObjects); 102 reader.Skip(); 100 103 machines = (IntData)PersistenceManager.Restore(reader, "Machines", restoredObjects); 104 reader.Read(); 101 105 } 102 106 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Scheduling.JSSP/Operation.cs
r121 r123 161 161 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 162 162 base.Populate(reader, restoredObjects); 163 reader.Read(); 163 164 job = (IntData)PersistenceManager.Restore(reader, "Job", restoredObjects); 165 reader.Skip(); 164 166 operationIndex = (IntData)PersistenceManager.Restore(reader, "OperationIndex", restoredObjects); 167 reader.Skip(); 165 168 start = (IntData)PersistenceManager.Restore(reader, "Start", restoredObjects); 169 reader.Skip(); 166 170 duration = (IntData)PersistenceManager.Restore(reader, "Duration", restoredObjects); 171 reader.Skip(); 167 172 predecessors = (ItemList)PersistenceManager.Restore(reader, "Predecessors", restoredObjects); 173 reader.Skip(); 168 174 machines = (IntArrayData)PersistenceManager.Restore(reader, "Machines", restoredObjects); 175 reader.Read(); 169 176 } 170 177 -
branches/XmlTextReaderBranch/HeuristicLab.Scheduling.JSSP/Schedule.cs
r122 r123 91 91 for(int i = 0; i < machines; i++) { 92 92 schedule[i] = (ScheduleTree)PersistenceManager.Restore(reader, "Machine" + i.ToString(), restoredObjects); 93 reader.Skip(); 93 94 } 94 95 } -
branches/XmlTextReaderBranch/HeuristicLab.Scheduling.JSSP/ScheduleInjector.cs
r121 r123 80 80 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 81 81 base.Populate(reader, restoredObjects); 82 if(reader.IsStartElement()) 82 83 if(reader.Name == "Schedule") { 83 84 schedule = (Schedule)PersistenceManager.Restore(reader, "Schedule", restoredObjects); 85 reader.Read(); 86 } 84 87 } 85 88 #endregion -
branches/XmlTextReaderBranch/HeuristicLab.Scheduling.JSSP/ScheduleTree.cs
r122 r123 225 225 //} 226 226 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 227 base.Populate(reader, restoredObjects); 227 228 string[] tokens = reader.ReadString().Split(';'); 228 base.Populate(reader, restoredObjects);229 229 for(int i = 0; i < tokens.Length - 1; i++) { 230 230 TimeSlot t = new TimeSlot(tokens[i]); -
branches/XmlTextReaderBranch/HeuristicLab.StructureIdentification/GPOperatorLibrary.cs
r121 r123 79 79 public override void Populate(XmlReader reader, IDictionary<Guid, IStorable> restoredObjects) { 80 80 base.Populate(reader, restoredObjects); 81 reader.Read(); 81 82 group = (GPOperatorGroup)PersistenceManager.Restore(reader, "Group", restoredObjects); 83 reader.Read(); 82 84 } 83 85 #endregion
Note: See TracChangeset
for help on using the changeset viewer.