Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4929


Ignore:
Timestamp:
11/25/10 02:51:45 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

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  
    105105    <Compile Include="ServiceClients\AlgorithmData.cs" />
    106106    <Compile Include="ServiceClients\AlgorithmParameter.cs" />
     107    <Compile Include="ServiceClients\Run.cs" />
     108    <Compile Include="ServiceClients\Experiment.cs" />
    107109    <Compile Include="ServiceClients\Result.cs" />
    108110    <Compile Include="ServiceClients\ProblemParameter.cs" />
     
    159161      <DependentUpon>AlgorithmParameterCollectionView.cs</DependentUpon>
    160162    </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>
    161193    <Compile Include="Views\ResultCollectionView.cs">
    162194      <SubType>UserControl</SubType>
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBClient.cs

    r4918 r4929  
    323323
    324324    #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 {
    328327        IProblem problem = algorithm.Problem;
    329328
     
    346345        r.ClientId = Guid.NewGuid();
    347346        r.FinishedDate = DateTime.Now;
    348         r.RandomSeed = ((IntValue)((IValueParameter)run.Parameters["Seed"]).Value).Value;
     347        r.RandomSeed = ((IntValue)((IValueParameter)algorithm.Parameters["Seed"]).Value).Value;
    349348        r.ResultValues = resultValues.ToArray();
    350349        r.Store();
     
    361360      List<AlgorithmParameterValue> values = new List<AlgorithmParameterValue>();
    362361      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")) {
    364363          AlgorithmParameter p = parameters.FirstOrDefault(x => x.Name == prefix + param.Name);
    365364          if (p == null) {
     
    376375          value.AlgorithmParameterId = p.Id;
    377376          value.DataTypeId = ConvertToDataType(param.Value.GetType()).Id;
     377          values.Add(value);
    378378        }
    379379
     
    424424          value.ProblemParameterId = p.Id;
    425425          value.DataTypeId = ConvertToDataType(param.Value.GetType()).Id;
     426          values.Add(value);
    426427        }
    427428
     
    457458      List<ResultValue> values = new List<ResultValue>();
    458459      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);
    468476        }
    469477      }
    470478      return values;
    471479    }
    472     private ResultValue CreateRestValue(IItem item) {
     480    private ResultValue CreateResultValue(IItem item) {
    473481      if (item is BoolValue) {
    474482        ResultBoolValue value = new ResultBoolValue();
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBExperiment.cs

    r4918 r4929  
    290290        Algorithm.Started += new EventHandler(algorithm_Started);
    291291        Algorithm.Stopped += new EventHandler(algorithm_Stopped);
    292         Algorithm.Runs.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);
    293292      }
    294293    }
     
    303302        Algorithm.Started -= new EventHandler(algorithm_Started);
    304303        Algorithm.Stopped -= new EventHandler(algorithm_Stopped);
    305         Algorithm.Runs.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);
    306304      }
    307305    }
     
    329327    private void algorithm_Stopped(object sender, EventArgs e) {
    330328      OnStopped();
    331     }
    332     private void Runs_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IRun> e) {
     329
    333330      try {
    334         foreach (HeuristicLab.Optimization.Run run in e.Items)
    335           OKBClient.Instance.AddRun(AlgorithmId, ProblemId, run);
     331        OKBClient.Instance.AddRun(AlgorithmId, ProblemId, algorithm);
    336332      }
    337333      catch (Exception ex) {
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.Designer.cs

    r4492 r4929  
    5656      this.dataTabPage = new System.Windows.Forms.TabPage();
    5757      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();
    5867      this.tabControl.SuspendLayout();
    5968      this.usersTabPage.SuspendLayout();
    6069      this.dataTabPage.SuspendLayout();
     70      this.parametersTabPage.SuspendLayout();
     71      this.resultsTabPage.SuspendLayout();
     72      this.experimentsTabPage.SuspendLayout();
    6173      this.SuspendLayout();
    6274      //
     
    138150      this.tabControl.Controls.Add(this.usersTabPage);
    139151      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);
    140155      this.tabControl.Location = new System.Drawing.Point(0, 162);
    141156      this.tabControl.Name = "tabControl";
     
    203218      this.algorithmDataView.Size = new System.Drawing.Size(613, 254);
    204219      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;
    205325      //
    206326      // AlgorithmView
     
    227347      this.usersTabPage.ResumeLayout(false);
    228348      this.dataTabPage.ResumeLayout(false);
     349      this.parametersTabPage.ResumeLayout(false);
     350      this.resultsTabPage.ResumeLayout(false);
     351      this.experimentsTabPage.ResumeLayout(false);
    229352      this.ResumeLayout(false);
    230353      this.PerformLayout();
     
    245368    private System.Windows.Forms.TabPage dataTabPage;
    246369    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;
    247379
    248380  }
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.cs

    r4558 r4929  
    123123      storeUsersButton.Enabled = !ReadOnly;
    124124    }
     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    }
    125137  }
    126138}
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ResultCollectionView.cs

    r4566 r4929  
    3131    public ResultCollectionView() {
    3232      InitializeComponent();
    33       itemsGroupBox.Text = "Result";
     33      itemsGroupBox.Text = "Results";
    3434    }
    3535
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/app.config

    r4918 r4929  
    77                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    88                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    9                     maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
     9                    maxBufferPoolSize="524288" maxReceivedMessageSize="200000000"
    1010                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    1111                    allowCookies="false">
  • branches/OKB/HeuristicLab.Services.OKB/3.3/OKBService.cs

    r4591 r4929  
    463463        okb.LoadOptions = dlo;
    464464
    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();
    466466        ExperimentEqualityComparer comparer = new ExperimentEqualityComparer();
    467467        Experiment exp = experiments.FirstOrDefault(x => comparer.Equals(x, entity));
Note: See TracChangeset for help on using the changeset viewer.