Changeset 4929
- Timestamp:
- 11/25/10 02:51:45 (14 years ago)
- Location:
- branches/OKB
- Files:
-
- 12 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/HeuristicLab.Clients.OKB-3.3.csproj
r4918 r4929 105 105 <Compile Include="ServiceClients\AlgorithmData.cs" /> 106 106 <Compile Include="ServiceClients\AlgorithmParameter.cs" /> 107 <Compile Include="ServiceClients\Run.cs" /> 108 <Compile Include="ServiceClients\Experiment.cs" /> 107 109 <Compile Include="ServiceClients\Result.cs" /> 108 110 <Compile Include="ServiceClients\ProblemParameter.cs" /> … … 159 161 <DependentUpon>AlgorithmParameterCollectionView.cs</DependentUpon> 160 162 </Compile> 163 <Compile Include="Views\AlgorithmParameterView.cs"> 164 <SubType>UserControl</SubType> 165 </Compile> 166 <Compile Include="Views\AlgorithmParameterView.Designer.cs"> 167 <DependentUpon>AlgorithmParameterView.cs</DependentUpon> 168 </Compile> 169 <Compile Include="Views\RunCollectionView.cs"> 170 <SubType>UserControl</SubType> 171 </Compile> 172 <Compile Include="Views\RunCollectionView.Designer.cs"> 173 <DependentUpon>RunCollectionView.cs</DependentUpon> 174 </Compile> 175 <Compile Include="Views\ExperimentCollectionView.cs"> 176 <SubType>UserControl</SubType> 177 </Compile> 178 <Compile Include="Views\ExperimentCollectionView.Designer.cs"> 179 <DependentUpon>ExperimentCollectionView.cs</DependentUpon> 180 </Compile> 181 <Compile Include="Views\ProblemParameterView.cs"> 182 <SubType>UserControl</SubType> 183 </Compile> 184 <Compile Include="Views\ProblemParameterView.Designer.cs"> 185 <DependentUpon>ProblemParameterView.cs</DependentUpon> 186 </Compile> 187 <Compile Include="Views\ResultView.cs"> 188 <SubType>UserControl</SubType> 189 </Compile> 190 <Compile Include="Views\ResultView.Designer.cs"> 191 <DependentUpon>ResultView.cs</DependentUpon> 192 </Compile> 161 193 <Compile Include="Views\ResultCollectionView.cs"> 162 194 <SubType>UserControl</SubType> -
branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBClient.cs
r4918 r4929 323 323 324 324 #region Run Methods 325 public bool AddRun(long algorithmId, long problemId, HeuristicLab.Optimization.Run run) { 326 try { 327 IAlgorithm algorithm = run.Algorithm; 325 public bool AddRun(long algorithmId, long problemId, IAlgorithm algorithm) { 326 try { 328 327 IProblem problem = algorithm.Problem; 329 328 … … 346 345 r.ClientId = Guid.NewGuid(); 347 346 r.FinishedDate = DateTime.Now; 348 r.RandomSeed = ((IntValue)((IValueParameter) run.Parameters["Seed"]).Value).Value;347 r.RandomSeed = ((IntValue)((IValueParameter)algorithm.Parameters["Seed"]).Value).Value; 349 348 r.ResultValues = resultValues.ToArray(); 350 349 r.Store(); … … 361 360 List<AlgorithmParameterValue> values = new List<AlgorithmParameterValue>(); 362 361 foreach (IValueParameter param in item.Parameters.OfType<IValueParameter>()) { 363 if (param.GetsCollected && (param.Value != null) ) {362 if (param.GetsCollected && (param.Value != null) && (param.Name != "Seed")) { 364 363 AlgorithmParameter p = parameters.FirstOrDefault(x => x.Name == prefix + param.Name); 365 364 if (p == null) { … … 376 375 value.AlgorithmParameterId = p.Id; 377 376 value.DataTypeId = ConvertToDataType(param.Value.GetType()).Id; 377 values.Add(value); 378 378 } 379 379 … … 424 424 value.ProblemParameterId = p.Id; 425 425 value.DataTypeId = ConvertToDataType(param.Value.GetType()).Id; 426 values.Add(value); 426 427 } 427 428 … … 457 458 List<ResultValue> values = new List<ResultValue>(); 458 459 foreach (IResult result in algorithm.Results) { 459 if ((result.Value != null) && (results.FirstOrDefault(x => x.Name == result.Name) == null)) { 460 Result r = new Result(); 461 r.Name = result.Name; 462 r.Alias = result.Name; 463 r.Description = result.Description; 464 r.AlgorithmId = algorithmId; 465 r.DataTypeId = ConvertToDataType(result.DataType).Id; 466 r.Store(); 467 results.Add(r); 460 if (result.Value != null) { 461 Result r = results.FirstOrDefault(x => x.Name == result.Name); 462 if (r == null) { 463 r = new Result(); 464 r.Name = result.Name; 465 r.Alias = result.Name; 466 r.Description = result.Description; 467 r.AlgorithmId = algorithmId; 468 r.DataTypeId = ConvertToDataType(result.DataType).Id; 469 r.Store(); 470 results.Add(r); 471 } 472 ResultValue value = CreateResultValue(result.Value); 473 value.ResultId = r.Id; 474 value.DataTypeId = ConvertToDataType(result.Value.GetType()).Id; 475 values.Add(value); 468 476 } 469 477 } 470 478 return values; 471 479 } 472 private ResultValue CreateRes iötValue(IItem item) {480 private ResultValue CreateResultValue(IItem item) { 473 481 if (item is BoolValue) { 474 482 ResultBoolValue value = new ResultBoolValue(); -
branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBExperiment.cs
r4918 r4929 290 290 Algorithm.Started += new EventHandler(algorithm_Started); 291 291 Algorithm.Stopped += new EventHandler(algorithm_Stopped); 292 Algorithm.Runs.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);293 292 } 294 293 } … … 303 302 Algorithm.Started -= new EventHandler(algorithm_Started); 304 303 Algorithm.Stopped -= new EventHandler(algorithm_Stopped); 305 Algorithm.Runs.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);306 304 } 307 305 } … … 329 327 private void algorithm_Stopped(object sender, EventArgs e) { 330 328 OnStopped(); 331 } 332 private void Runs_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IRun> e) { 329 333 330 try { 334 foreach (HeuristicLab.Optimization.Run run in e.Items) 335 OKBClient.Instance.AddRun(AlgorithmId, ProblemId, run); 331 OKBClient.Instance.AddRun(AlgorithmId, ProblemId, algorithm); 336 332 } 337 333 catch (Exception ex) { -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.Designer.cs
r4492 r4929 56 56 this.dataTabPage = new System.Windows.Forms.TabPage(); 57 57 this.algorithmDataView = new HeuristicLab.Clients.OKB.AlgorithmDataView(); 58 this.parametersTabPage = new System.Windows.Forms.TabPage(); 59 this.algorithmParameterCollectionView = new HeuristicLab.Clients.OKB.AlgorithmParameterCollectionView(); 60 this.refreshParametersButton = new System.Windows.Forms.Button(); 61 this.resultsTabPage = new System.Windows.Forms.TabPage(); 62 this.resultCollectionView = new HeuristicLab.Clients.OKB.ResultCollectionView(); 63 this.refreshResultsButton = new System.Windows.Forms.Button(); 64 this.experimentsTabPage = new System.Windows.Forms.TabPage(); 65 this.refreshExperimentsButton = new System.Windows.Forms.Button(); 66 this.experimentCollectionView = new HeuristicLab.Clients.OKB.ExperimentCollectionView(); 58 67 this.tabControl.SuspendLayout(); 59 68 this.usersTabPage.SuspendLayout(); 60 69 this.dataTabPage.SuspendLayout(); 70 this.parametersTabPage.SuspendLayout(); 71 this.resultsTabPage.SuspendLayout(); 72 this.experimentsTabPage.SuspendLayout(); 61 73 this.SuspendLayout(); 62 74 // … … 138 150 this.tabControl.Controls.Add(this.usersTabPage); 139 151 this.tabControl.Controls.Add(this.dataTabPage); 152 this.tabControl.Controls.Add(this.parametersTabPage); 153 this.tabControl.Controls.Add(this.resultsTabPage); 154 this.tabControl.Controls.Add(this.experimentsTabPage); 140 155 this.tabControl.Location = new System.Drawing.Point(0, 162); 141 156 this.tabControl.Name = "tabControl"; … … 203 218 this.algorithmDataView.Size = new System.Drawing.Size(613, 254); 204 219 this.algorithmDataView.TabIndex = 0; 220 // 221 // parametersTabPage 222 // 223 this.parametersTabPage.Controls.Add(this.algorithmParameterCollectionView); 224 this.parametersTabPage.Controls.Add(this.refreshParametersButton); 225 this.parametersTabPage.Location = new System.Drawing.Point(4, 22); 226 this.parametersTabPage.Name = "parametersTabPage"; 227 this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3); 228 this.parametersTabPage.Size = new System.Drawing.Size(625, 266); 229 this.parametersTabPage.TabIndex = 2; 230 this.parametersTabPage.Text = "Parameters"; 231 this.parametersTabPage.UseVisualStyleBackColor = true; 232 // 233 // algorithmParameterCollectionView 234 // 235 this.algorithmParameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 236 | System.Windows.Forms.AnchorStyles.Left) 237 | System.Windows.Forms.AnchorStyles.Right))); 238 this.algorithmParameterCollectionView.Caption = "AlgorithmParameterCollection View"; 239 this.algorithmParameterCollectionView.Content = null; 240 this.algorithmParameterCollectionView.Location = new System.Drawing.Point(6, 36); 241 this.algorithmParameterCollectionView.Name = "algorithmParameterCollectionView"; 242 this.algorithmParameterCollectionView.ReadOnly = false; 243 this.algorithmParameterCollectionView.Size = new System.Drawing.Size(613, 224); 244 this.algorithmParameterCollectionView.TabIndex = 1; 245 // 246 // refreshParametersButton 247 // 248 this.refreshParametersButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Refresh; 249 this.refreshParametersButton.Location = new System.Drawing.Point(6, 6); 250 this.refreshParametersButton.Name = "refreshParametersButton"; 251 this.refreshParametersButton.Size = new System.Drawing.Size(24, 24); 252 this.refreshParametersButton.TabIndex = 0; 253 this.refreshParametersButton.UseVisualStyleBackColor = true; 254 this.refreshParametersButton.Click += new System.EventHandler(this.refreshParametersButton_Click); 255 // 256 // resultsTabPage 257 // 258 this.resultsTabPage.Controls.Add(this.resultCollectionView); 259 this.resultsTabPage.Controls.Add(this.refreshResultsButton); 260 this.resultsTabPage.Location = new System.Drawing.Point(4, 22); 261 this.resultsTabPage.Name = "resultsTabPage"; 262 this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3); 263 this.resultsTabPage.Size = new System.Drawing.Size(625, 266); 264 this.resultsTabPage.TabIndex = 3; 265 this.resultsTabPage.Text = "Results"; 266 this.resultsTabPage.UseVisualStyleBackColor = true; 267 // 268 // resultCollectionView 269 // 270 this.resultCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 271 | System.Windows.Forms.AnchorStyles.Left) 272 | System.Windows.Forms.AnchorStyles.Right))); 273 this.resultCollectionView.Caption = "ResultCollection View"; 274 this.resultCollectionView.Content = null; 275 this.resultCollectionView.Location = new System.Drawing.Point(6, 36); 276 this.resultCollectionView.Name = "resultCollectionView"; 277 this.resultCollectionView.ReadOnly = false; 278 this.resultCollectionView.Size = new System.Drawing.Size(613, 224); 279 this.resultCollectionView.TabIndex = 1; 280 // 281 // refreshResultsButton 282 // 283 this.refreshResultsButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Refresh; 284 this.refreshResultsButton.Location = new System.Drawing.Point(6, 6); 285 this.refreshResultsButton.Name = "refreshResultsButton"; 286 this.refreshResultsButton.Size = new System.Drawing.Size(24, 24); 287 this.refreshResultsButton.TabIndex = 0; 288 this.refreshResultsButton.UseVisualStyleBackColor = true; 289 this.refreshResultsButton.Click += new System.EventHandler(this.refreshResultsButton_Click); 290 // 291 // experimentsTabPage 292 // 293 this.experimentsTabPage.Controls.Add(this.experimentCollectionView); 294 this.experimentsTabPage.Controls.Add(this.refreshExperimentsButton); 295 this.experimentsTabPage.Location = new System.Drawing.Point(4, 22); 296 this.experimentsTabPage.Name = "experimentsTabPage"; 297 this.experimentsTabPage.Padding = new System.Windows.Forms.Padding(3); 298 this.experimentsTabPage.Size = new System.Drawing.Size(625, 266); 299 this.experimentsTabPage.TabIndex = 4; 300 this.experimentsTabPage.Text = "Experiments"; 301 this.experimentsTabPage.UseVisualStyleBackColor = true; 302 // 303 // refreshExperimentsButton 304 // 305 this.refreshExperimentsButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Refresh; 306 this.refreshExperimentsButton.Location = new System.Drawing.Point(6, 6); 307 this.refreshExperimentsButton.Name = "refreshExperimentsButton"; 308 this.refreshExperimentsButton.Size = new System.Drawing.Size(24, 24); 309 this.refreshExperimentsButton.TabIndex = 0; 310 this.refreshExperimentsButton.UseVisualStyleBackColor = true; 311 this.refreshExperimentsButton.Click += new System.EventHandler(this.refreshExperimentsButton_Click); 312 // 313 // experimentCollectionView 314 // 315 this.experimentCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 316 | System.Windows.Forms.AnchorStyles.Left) 317 | System.Windows.Forms.AnchorStyles.Right))); 318 this.experimentCollectionView.Caption = "ExperimentCollection View"; 319 this.experimentCollectionView.Content = null; 320 this.experimentCollectionView.Location = new System.Drawing.Point(6, 36); 321 this.experimentCollectionView.Name = "experimentCollectionView"; 322 this.experimentCollectionView.ReadOnly = false; 323 this.experimentCollectionView.Size = new System.Drawing.Size(613, 224); 324 this.experimentCollectionView.TabIndex = 1; 205 325 // 206 326 // AlgorithmView … … 227 347 this.usersTabPage.ResumeLayout(false); 228 348 this.dataTabPage.ResumeLayout(false); 349 this.parametersTabPage.ResumeLayout(false); 350 this.resultsTabPage.ResumeLayout(false); 351 this.experimentsTabPage.ResumeLayout(false); 229 352 this.ResumeLayout(false); 230 353 this.PerformLayout(); … … 245 368 private System.Windows.Forms.TabPage dataTabPage; 246 369 private AlgorithmDataView algorithmDataView; 370 private System.Windows.Forms.TabPage parametersTabPage; 371 private System.Windows.Forms.TabPage resultsTabPage; 372 private AlgorithmParameterCollectionView algorithmParameterCollectionView; 373 private System.Windows.Forms.Button refreshParametersButton; 374 private System.Windows.Forms.Button refreshResultsButton; 375 private System.Windows.Forms.TabPage experimentsTabPage; 376 private ResultCollectionView resultCollectionView; 377 private ExperimentCollectionView experimentCollectionView; 378 private System.Windows.Forms.Button refreshExperimentsButton; 247 379 248 380 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.cs
r4558 r4929 123 123 storeUsersButton.Enabled = !ReadOnly; 124 124 } 125 126 private void refreshParametersButton_Click(object sender, EventArgs e) { 127 algorithmParameterCollectionView.Content = OKBClient.Instance.GetAlgorithmParameters(Content.Id); 128 } 129 130 private void refreshResultsButton_Click(object sender, EventArgs e) { 131 resultCollectionView.Content = OKBClient.Instance.GetResults(Content.Id); 132 } 133 134 private void refreshExperimentsButton_Click(object sender, EventArgs e) { 135 experimentCollectionView.Content = null; // TODO 136 } 125 137 } 126 138 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ResultCollectionView.cs
r4566 r4929 31 31 public ResultCollectionView() { 32 32 InitializeComponent(); 33 itemsGroupBox.Text = "Result ";33 itemsGroupBox.Text = "Results"; 34 34 } 35 35 -
branches/OKB/HeuristicLab.Clients.OKB-3.3/app.config
r4918 r4929 7 7 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 8 8 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 9 maxBufferPoolSize="524288" maxReceivedMessageSize=" 65536"9 maxBufferPoolSize="524288" maxReceivedMessageSize="200000000" 10 10 messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 11 11 allowCookies="false"> -
branches/OKB/HeuristicLab.Services.OKB/3.3/OKBService.cs
r4591 r4929 463 463 okb.LoadOptions = dlo; 464 464 465 var experiments = okb.Experiments.Where(x => ((x.AlgorithmId == entity.AlgorithmId) && (x.ProblemId == entity.ProblemId))) ;465 var experiments = okb.Experiments.Where(x => ((x.AlgorithmId == entity.AlgorithmId) && (x.ProblemId == entity.ProblemId))).ToArray(); 466 466 ExperimentEqualityComparer comparer = new ExperimentEqualityComparer(); 467 467 Experiment exp = experiments.FirstOrDefault(x => comparer.Equals(x, entity));
Note: See TracChangeset
for help on using the changeset viewer.