Changeset 23 for cpp/f8-to-f1
- Timestamp:
- 06/27/09 11:12:12 (16 years ago)
- Location:
- cpp/f8-to-f1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/f8-to-f1/conv_f8tof1.cpp
r11 r23 702 702 subProdIter != prodIter->second->subproductions.end(); subProdIter++) { 703 703 SubProduction subProduction = *subProdIter; 704 for (vector<ActionStrP>::iterator actionIter = subProduction.actions.begin(); 705 actionIter != subProduction.actions.end(); actionIter++) { 706 if ((*actionIter).action == NULL) { 707 subProduction.actions.erase(actionIter); 704 for (int i = 0; i < subProduction.actions.size(); i++) { 705 if (subProduction.actions.at(i).action == NULL) { 706 subProduction.actions.erase(subProduction.actions.begin() + i); 708 707 } 709 708 } -
cpp/f8-to-f1/geno_f8.cpp
r22 r23 1136 1136 1137 1137 //actions 1138 for (vector<ActionStrP>::iterator actionIter = (*subprodIter).actions.begin(); 1139 actionIter != (*subprodIter).actions.end(); actionIter++) { 1140 if ((*actionIter).action == NULL) { 1138 for (int i = 0; i < (*subprodIter).actions.size(); i++) { 1139 if ((*subprodIter).actions.at(i).action == NULL) { 1141 1140 continue; 1142 1141 } 1143 SString &actionName = (* actionIter).action->name;1142 SString &actionName = (*subprodIter).actions.at(i).action->name; 1144 1143 if (actionName[0] == 'n') { 1145 1144 if (paramNames.size() > 0) { … … 1148 1147 if (searchIter != paramNames.end()) { //valid name 1149 1148 //ensure it is linked to the correct production 1150 (* actionIter).action = newLsystem->getParamProduction(actionName);1149 (*subprodIter).actions.at(i).action = newLsystem->getParamProduction(actionName); 1151 1150 } else { 1152 1151 //link to random parameter prodution 1153 1152 SString name = paramNames[randomN(paramNames.size())]; 1154 (* actionIter).action = newLsystem->getParamProduction(name);1153 (*subprodIter).actions.at(i).action = newLsystem->getParamProduction(name); 1155 1154 } 1156 1155 } else { //no params, so delete this param production 1157 (*subprodIter).actions.erase( actionIter); //TODO sprawdzić zachowanie iteratora!!!1156 (*subprodIter).actions.erase((*subprodIter).actions.begin() + i); 1158 1157 } 1159 1158 } else if (actionName[0] == 'P') { 1160 1159 if (newLsystem->productions.find(sstringToString(actionName)) != newLsystem->productions.end()) { 1161 1160 //ensure it is linked to the correct production 1162 (* actionIter).action = newLsystem->productions[sstringToString(actionName)];1161 (*subprodIter).actions.at(i).action = newLsystem->productions[sstringToString(actionName)]; 1163 1162 } else { 1164 1163 //delete this action 1165 (*subprodIter).actions.erase( actionIter);1164 (*subprodIter).actions.erase((*subprodIter).actions.begin() + i); 1166 1165 } 1167 1166 }
Note: See TracChangeset
for help on using the changeset viewer.