- Timestamp:
- 04/10/13 13:29:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Controller/Parsers/AlgorithmConverter.cs
r9324 r9350 189 189 jrun["name"] = run.Name; 190 190 jrun["results"] = ConvertParametersToJson(run.Results); 191 jrun["params"] = ConvertParametersToJson(run.InputParameters); 191 192 return jrun; 192 193 } … … 196 197 foreach (var run in runs) 197 198 jarray.Add(ConvertRunToJson(run)); 199 200 201 // if there are multiple different jobs to execute and they have the same id, we must change it here manually 202 var maxId = new Dictionary<string,int>(); 203 for (int i = 0; i < jarray.Count; i++) { 204 for (int j = i + 1; j < jarray.Count; j++) { 205 if (jarray[i]["id"].ToString() == jarray[j]["id"].ToString()) { 206 int max; 207 if (!maxId.TryGetValue(jarray[i]["id"].ToString(), out max)) { 208 max = 1; 209 maxId[jarray[i]["id"].ToString()] = max; 210 } 211 maxId[jarray[i]["id"].ToString()]++; 212 // change j's entry 213 jarray[j]["id"] = jarray[j]["id"].ToString() + " (" + max + ")"; 214 jarray[j]["name"] = jarray[j]["name"] + " (" + max + ")"; 215 } 216 } 217 } 198 218 return jarray; 199 219 }
Note: See TracChangeset
for help on using the changeset viewer.