Index: /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.dbml
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.dbml (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.dbml (revision 13682)
@@ -49,4 +49,5 @@
+
@@ -89,4 +90,5 @@
+
@@ -103,4 +105,5 @@
+
@@ -114,4 +117,5 @@
+
@@ -162,3 +166,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.dbml.layout
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.dbml.layout (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.dbml.layout (revision 13682)
@@ -1,55 +1,55 @@
-
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
@@ -58,5 +58,5 @@
-
+
@@ -65,5 +65,5 @@
-
+
@@ -72,5 +72,5 @@
-
+
@@ -79,8 +79,8 @@
-
+
-
+
@@ -113,11 +113,11 @@
-
+
-
-
-
-
+
+
+
+
@@ -126,5 +126,5 @@
-
+
@@ -133,11 +133,11 @@
-
+
-
-
-
-
+
+
+
+
@@ -146,5 +146,5 @@
-
+
@@ -153,11 +153,11 @@
-
+
-
-
-
-
+
+
+
+
@@ -173,5 +173,5 @@
-
+
@@ -187,14 +187,14 @@
-
+
-
-
-
-
+
+
+
+
-
+
@@ -206,5 +206,5 @@
-
+
@@ -213,9 +213,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.designer.cs (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB.DataAccess/3.3/OKB.designer.cs (revision 13682)
@@ -73,4 +73,7 @@
partial void UpdateCharacteristicValue(CharacteristicValue instance);
partial void DeleteCharacteristicValue(CharacteristicValue instance);
+ partial void InsertSingleObjectiveSolution(SingleObjectiveSolution instance);
+ partial void UpdateSingleObjectiveSolution(SingleObjectiveSolution instance);
+ partial void DeleteSingleObjectiveSolution(SingleObjectiveSolution instance);
#endregion
@@ -214,4 +217,12 @@
{
return this.GetTable();
+ }
+ }
+
+ public System.Data.Linq.Table SingleObjectiveSolutions
+ {
+ get
+ {
+ return this.GetTable();
}
}
@@ -934,4 +945,6 @@
private EntitySet _CharacteristicValues;
+ private EntitySet _SingleObjectiveSolutions;
+
#region Extensibility Method Definitions
partial void OnLoaded();
@@ -952,4 +965,5 @@
this._Values = new EntitySet(new Action(this.attach_Values), new Action(this.detach_Values));
this._CharacteristicValues = new EntitySet(new Action(this.attach_CharacteristicValues), new Action(this.detach_CharacteristicValues));
+ this._SingleObjectiveSolutions = new EntitySet(new Action(this.attach_SingleObjectiveSolutions), new Action(this.detach_SingleObjectiveSolutions));
OnCreated();
}
@@ -1067,4 +1081,17 @@
}
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DataType_SingleObjectiveSolution", Storage="_SingleObjectiveSolutions", ThisKey="Id", OtherKey="DataTypeId")]
+ public EntitySet SingleObjectiveSolutions
+ {
+ get
+ {
+ return this._SingleObjectiveSolutions;
+ }
+ set
+ {
+ this._SingleObjectiveSolutions.Assign(value);
+ }
+ }
+
public event PropertyChangingEventHandler PropertyChanging;
@@ -1130,4 +1157,16 @@
private void detach_CharacteristicValues(CharacteristicValue entity)
+ {
+ this.SendPropertyChanging();
+ entity.DataType = null;
+ }
+
+ private void attach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
+ {
+ this.SendPropertyChanging();
+ entity.DataType = this;
+ }
+
+ private void detach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
{
this.SendPropertyChanging();
@@ -1750,4 +1789,6 @@
private EntitySet _CharacteristicValues;
+ private EntitySet _SingleObjectiveSolutions;
+
private EntityRef _DataType;
@@ -1783,4 +1824,5 @@
this._Runs = new EntitySet(new Action(this.attach_Runs), new Action(this.detach_Runs));
this._CharacteristicValues = new EntitySet(new Action(this.attach_CharacteristicValues), new Action(this.detach_CharacteristicValues));
+ this._SingleObjectiveSolutions = new EntitySet(new Action(this.attach_SingleObjectiveSolutions), new Action(this.detach_SingleObjectiveSolutions));
this._DataType = default(EntityRef);
this._Platform = default(EntityRef);
@@ -1985,4 +2027,17 @@
}
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Problem_SingleObjectiveSolution", Storage="_SingleObjectiveSolutions", ThisKey="Id", OtherKey="ProblemId")]
+ public EntitySet SingleObjectiveSolutions
+ {
+ get
+ {
+ return this._SingleObjectiveSolutions;
+ }
+ set
+ {
+ this._SingleObjectiveSolutions.Assign(value);
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DataType_Problem", Storage="_DataType", ThisKey="DataTypeId", OtherKey="Id", IsForeignKey=true)]
public DataType DataType
@@ -2172,4 +2227,16 @@
private void detach_CharacteristicValues(CharacteristicValue entity)
+ {
+ this.SendPropertyChanging();
+ entity.Problem = null;
+ }
+
+ private void attach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
+ {
+ this.SendPropertyChanging();
+ entity.Problem = this;
+ }
+
+ private void detach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
{
this.SendPropertyChanging();
@@ -2195,4 +2262,6 @@
private EntitySet _Values;
+
+ private EntitySet _SingleObjectiveSolutions;
#region Extensibility Method Definitions
@@ -2213,4 +2282,5 @@
this._Problems = new EntitySet(new Action(this.attach_Problems), new Action(this.detach_Problems));
this._Values = new EntitySet(new Action(this.attach_Values), new Action(this.detach_Values));
+ this._SingleObjectiveSolutions = new EntitySet(new Action(this.attach_SingleObjectiveSolutions), new Action(this.detach_SingleObjectiveSolutions));
OnCreated();
}
@@ -2315,4 +2385,17 @@
}
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="BinaryData_SingleObjectiveSolution", Storage="_SingleObjectiveSolutions", ThisKey="Id", OtherKey="BinaryDataId")]
+ public EntitySet SingleObjectiveSolutions
+ {
+ get
+ {
+ return this._SingleObjectiveSolutions;
+ }
+ set
+ {
+ this._SingleObjectiveSolutions.Assign(value);
+ }
+ }
+
public event PropertyChangingEventHandler PropertyChanging;
@@ -2366,4 +2449,16 @@
private void detach_Values(Value entity)
+ {
+ this.SendPropertyChanging();
+ entity.BinaryData = null;
+ }
+
+ private void attach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
+ {
+ this.SendPropertyChanging();
+ entity.BinaryData = this;
+ }
+
+ private void detach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
{
this.SendPropertyChanging();
@@ -2391,4 +2486,6 @@
private EntitySet _Values;
+
+ private EntitySet _SingleObjectiveSolutions;
private EntityRef _Algorithm;
@@ -2417,4 +2514,5 @@
{
this._Values = new EntitySet(new Action(this.attach_Values), new Action(this.detach_Values));
+ this._SingleObjectiveSolutions = new EntitySet(new Action(this.attach_SingleObjectiveSolutions), new Action(this.detach_SingleObjectiveSolutions));
this._Algorithm = default(EntityRef);
this._Problem = default(EntityRef);
@@ -2563,4 +2661,17 @@
}
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Run_SingleObjectiveSolution", Storage="_SingleObjectiveSolutions", ThisKey="Id", OtherKey="RunId")]
+ public EntitySet SingleObjectiveSolutions
+ {
+ get
+ {
+ return this._SingleObjectiveSolutions;
+ }
+ set
+ {
+ this._SingleObjectiveSolutions.Assign(value);
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Algorithm_Run", Storage="_Algorithm", ThisKey="AlgorithmId", OtherKey="Id", IsForeignKey=true)]
public Algorithm Algorithm
@@ -2658,4 +2769,16 @@
private void detach_Values(Value entity)
+ {
+ this.SendPropertyChanging();
+ entity.Run = null;
+ }
+
+ private void attach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
+ {
+ this.SendPropertyChanging();
+ entity.Run = this;
+ }
+
+ private void detach_SingleObjectiveSolutions(SingleObjectiveSolution entity)
{
this.SendPropertyChanging();
@@ -3668,4 +3791,350 @@
}
}
+
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SingleObjectiveSolution")]
+ public partial class SingleObjectiveSolution : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private long _Id;
+
+ private System.Nullable _ProblemId;
+
+ private System.Nullable _BinaryDataId;
+
+ private System.Nullable _RunId;
+
+ private double _Quality;
+
+ private System.Nullable _DataTypeId;
+
+ private EntityRef _Problem;
+
+ private EntityRef _BinaryData;
+
+ private EntityRef _Run;
+
+ private EntityRef _DataType;
+
+ #region Extensibility Method Definitions
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnIdChanging(long value);
+ partial void OnIdChanged();
+ partial void OnProblemIdChanging(System.Nullable value);
+ partial void OnProblemIdChanged();
+ partial void OnBinaryDataIdChanging(System.Nullable value);
+ partial void OnBinaryDataIdChanged();
+ partial void OnRunIdChanging(System.Nullable value);
+ partial void OnRunIdChanged();
+ partial void OnQualityChanging(double value);
+ partial void OnQualityChanged();
+ partial void OnDataTypeIdChanging(System.Nullable value);
+ partial void OnDataTypeIdChanged();
+ #endregion
+
+ public SingleObjectiveSolution()
+ {
+ this._Problem = default(EntityRef);
+ this._BinaryData = default(EntityRef);
+ this._Run = default(EntityRef);
+ this._DataType = default(EntityRef);
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="BigInt NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
+ public long Id
+ {
+ get
+ {
+ return this._Id;
+ }
+ set
+ {
+ if ((this._Id != value))
+ {
+ this.OnIdChanging(value);
+ this.SendPropertyChanging();
+ this._Id = value;
+ this.SendPropertyChanged("Id");
+ this.OnIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProblemId", DbType="BigInt")]
+ public System.Nullable ProblemId
+ {
+ get
+ {
+ return this._ProblemId;
+ }
+ set
+ {
+ if ((this._ProblemId != value))
+ {
+ if (this._Problem.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnProblemIdChanging(value);
+ this.SendPropertyChanging();
+ this._ProblemId = value;
+ this.SendPropertyChanged("ProblemId");
+ this.OnProblemIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BinaryDataId", DbType="BigInt")]
+ public System.Nullable BinaryDataId
+ {
+ get
+ {
+ return this._BinaryDataId;
+ }
+ set
+ {
+ if ((this._BinaryDataId != value))
+ {
+ if (this._BinaryData.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnBinaryDataIdChanging(value);
+ this.SendPropertyChanging();
+ this._BinaryDataId = value;
+ this.SendPropertyChanged("BinaryDataId");
+ this.OnBinaryDataIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RunId", DbType="BigInt")]
+ public System.Nullable RunId
+ {
+ get
+ {
+ return this._RunId;
+ }
+ set
+ {
+ if ((this._RunId != value))
+ {
+ if (this._Run.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnRunIdChanging(value);
+ this.SendPropertyChanging();
+ this._RunId = value;
+ this.SendPropertyChanged("RunId");
+ this.OnRunIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quality", DbType="Float")]
+ public double Quality
+ {
+ get
+ {
+ return this._Quality;
+ }
+ set
+ {
+ if ((this._Quality != value))
+ {
+ this.OnQualityChanging(value);
+ this.SendPropertyChanging();
+ this._Quality = value;
+ this.SendPropertyChanged("Quality");
+ this.OnQualityChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DataTypeId", DbType="BigInt")]
+ public System.Nullable DataTypeId
+ {
+ get
+ {
+ return this._DataTypeId;
+ }
+ set
+ {
+ if ((this._DataTypeId != value))
+ {
+ if (this._DataType.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnDataTypeIdChanging(value);
+ this.SendPropertyChanging();
+ this._DataTypeId = value;
+ this.SendPropertyChanged("DataTypeId");
+ this.OnDataTypeIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Problem_SingleObjectiveSolution", Storage="_Problem", ThisKey="ProblemId", OtherKey="Id", IsForeignKey=true)]
+ public Problem Problem
+ {
+ get
+ {
+ return this._Problem.Entity;
+ }
+ set
+ {
+ Problem previousValue = this._Problem.Entity;
+ if (((previousValue != value)
+ || (this._Problem.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._Problem.Entity = null;
+ previousValue.SingleObjectiveSolutions.Remove(this);
+ }
+ this._Problem.Entity = value;
+ if ((value != null))
+ {
+ value.SingleObjectiveSolutions.Add(this);
+ this._ProblemId = value.Id;
+ }
+ else
+ {
+ this._ProblemId = default(Nullable);
+ }
+ this.SendPropertyChanged("Problem");
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="BinaryData_SingleObjectiveSolution", Storage="_BinaryData", ThisKey="BinaryDataId", OtherKey="Id", IsForeignKey=true)]
+ public BinaryData BinaryData
+ {
+ get
+ {
+ return this._BinaryData.Entity;
+ }
+ set
+ {
+ BinaryData previousValue = this._BinaryData.Entity;
+ if (((previousValue != value)
+ || (this._BinaryData.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._BinaryData.Entity = null;
+ previousValue.SingleObjectiveSolutions.Remove(this);
+ }
+ this._BinaryData.Entity = value;
+ if ((value != null))
+ {
+ value.SingleObjectiveSolutions.Add(this);
+ this._BinaryDataId = value.Id;
+ }
+ else
+ {
+ this._BinaryDataId = default(Nullable);
+ }
+ this.SendPropertyChanged("BinaryData");
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Run_SingleObjectiveSolution", Storage="_Run", ThisKey="RunId", OtherKey="Id", IsForeignKey=true)]
+ public Run Run
+ {
+ get
+ {
+ return this._Run.Entity;
+ }
+ set
+ {
+ Run previousValue = this._Run.Entity;
+ if (((previousValue != value)
+ || (this._Run.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._Run.Entity = null;
+ previousValue.SingleObjectiveSolutions.Remove(this);
+ }
+ this._Run.Entity = value;
+ if ((value != null))
+ {
+ value.SingleObjectiveSolutions.Add(this);
+ this._RunId = value.Id;
+ }
+ else
+ {
+ this._RunId = default(Nullable);
+ }
+ this.SendPropertyChanged("Run");
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DataType_SingleObjectiveSolution", Storage="_DataType", ThisKey="DataTypeId", OtherKey="Id", IsForeignKey=true)]
+ public DataType DataType
+ {
+ get
+ {
+ return this._DataType.Entity;
+ }
+ set
+ {
+ DataType previousValue = this._DataType.Entity;
+ if (((previousValue != value)
+ || (this._DataType.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._DataType.Entity = null;
+ previousValue.SingleObjectiveSolutions.Remove(this);
+ }
+ this._DataType.Entity = value;
+ if ((value != null))
+ {
+ value.SingleObjectiveSolutions.Add(this);
+ this._DataTypeId = value.Id;
+ }
+ else
+ {
+ this._DataTypeId = default(Nullable);
+ }
+ this.SendPropertyChanged("DataType");
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
}
#pragma warning restore 1591
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj (revision 13682)
@@ -283,4 +283,6 @@
+
+
@@ -295,4 +297,5 @@
+
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/Convert.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/Convert.cs (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/Convert.cs (revision 13682)
@@ -38,4 +38,14 @@
if (source == null) return null;
return new DT.Problem { Id = source.Id, Name = source.Name, Description = source.Description, ProblemClass = Convert.ToDto(source.ProblemClass), DataType = Convert.ToDto(source.DataType) };
+ }
+
+ public static DT.SingleObjectiveSolution ToDto(DA.SingleObjectiveSolution source) {
+ if (source == null) return null;
+ return new DT.SingleObjectiveSolution() {
+ Id = source.Id,
+ ProblemId = source.ProblemId.Value,
+ RunId = source.RunId,
+ Quality = source.Quality
+ };
}
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/DataTransfer/SingleObjectiveSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/DataTransfer/SingleObjectiveSolution.cs (revision 13682)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/DataTransfer/SingleObjectiveSolution.cs (revision 13682)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Services.OKB.RunCreation.DataTransfer {
+ [DataContract]
+ public class SingleObjectiveSolution : Solution {
+ [DataMember]
+ public double Quality { get; set; }
+ }
+}
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/DataTransfer/Solution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/DataTransfer/Solution.cs (revision 13682)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/DataTransfer/Solution.cs (revision 13682)
@@ -0,0 +1,40 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Services.OKB.RunCreation.DataTransfer {
+ [DataContract]
+ [KnownType(typeof(SingleObjectiveSolution))]
+ public class Solution {
+ [DataMember]
+ public long Id { get; set; }
+ [DataMember]
+ public long ProblemId { get; set; }
+ [DataMember]
+ public long? RunId { get; set; }
+ }
+}
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/IRunCreationService.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/IRunCreationService.cs (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/IRunCreationService.cs (revision 13682)
@@ -44,4 +44,12 @@
[OperationContract]
+ [FaultContract(typeof(MissingProblem))]
+ IEnumerable GetSolutions(long problemId);
+
+ [OperationContract]
+ [FaultContract(typeof(MissingSolution))]
+ byte[] GetSolutionData(long solutionId);
+
+ [OperationContract]
void AddRun(Run run);
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/MissingProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/MissingProblem.cs (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/MissingProblem.cs (revision 13682)
@@ -28,6 +28,6 @@
public string Message { get; set; }
- public MissingProblem(string message, params object[] c) {
- Message = string.Format(message, c);
+ public MissingProblem(long problemId) {
+ Message = string.Format("Problem with id {0} cannot be found", problemId);
}
}
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/MissingSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/MissingSolution.cs (revision 13682)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/MissingSolution.cs (revision 13682)
@@ -0,0 +1,34 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System.Runtime.Serialization;
+
+namespace HeuristicLab.Services.OKB.RunCreation {
+ [DataContract]
+ public class MissingSolution {
+ [DataMember]
+ public string Message { get; set; }
+
+ public MissingSolution(long solutionId) {
+ Message = string.Format("Solution with id {0} cannot be found", solutionId);
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs
===================================================================
--- /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs (revision 13681)
+++ /trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs (revision 13682)
@@ -127,4 +127,46 @@
}
+ public IEnumerable GetSolutions(long problemId) {
+ roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
+ using (OKBDataContext okb = new OKBDataContext()) {
+ var problem = okb.Problems.SingleOrDefault(x => x.Id == problemId);
+ if (problem == null) throw new FaultException(new MissingProblem(problemId));
+ // TODO: In case of multi-objective problems one has to check whether it contains single- or multi-objective problems
+ var result = problem.SingleObjectiveSolutions.Select(x => Convert.ToDto(x)).ToList();
+ if (roleVerifier.IsInRole(OKBRoles.OKBAdministrator)) {
+ return result;
+ } else {
+ var problemUsers = okb.ProblemUsers.Where(x => x.ProblemId == problemId).ToList();
+ if (problemUsers.Count == 0 || userManager.VerifyUser(userManager.CurrentUserId, problemUsers.Select(y => y.UserGroupId).ToList())) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+
+ public byte[] GetSolutionData(long solutionId) {
+ roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
+ using (OKBDataContext okb = new OKBDataContext()) {
+ var solution = okb.SingleObjectiveSolutions.SingleOrDefault(x => x.Id == solutionId);
+ if (solution == null) throw new FaultException(new MissingSolution(solutionId));
+
+ var result = solution.BinaryData.Data.ToArray();
+ if (roleVerifier.IsInRole(OKBRoles.OKBAdministrator)) {
+ return result;
+ } else {
+ var problemUsers = okb.ProblemUsers.Where(x => x.ProblemId == solution.ProblemId).ToList();
+ if (problemUsers.Count == 0 || userManager.VerifyUser(userManager.CurrentUserId, problemUsers.Select(y => y.UserGroupId).ToList())) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+
public void AddRun(DataTransfer.Run run) {
roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
@@ -150,5 +192,5 @@
using (OKBDataContext okb = new OKBDataContext()) {
var problem = okb.Problems.SingleOrDefault(x => x.Id == problemId);
- if (problem == null) throw new FaultException(new MissingProblem("Problem with id {0} cannot be found", problemId));
+ if (problem == null) throw new FaultException(new MissingProblem(problemId));
DoSetCharacteristicValue(okb, problem, value);
@@ -162,5 +204,5 @@
using (OKBDataContext okb = new OKBDataContext()) {
var problem = okb.Problems.SingleOrDefault(x => x.Id == problemId);
- if (problem == null) throw new FaultException(new MissingProblem("Problem with id {0} cannot be found", problemId));
+ if (problem == null) throw new FaultException(new MissingProblem(problemId));
foreach (var v in values) {