Changeset 6733
- Timestamp:
- 09/10/11 16:25:22 (13 years ago)
- Location:
- branches/GeneralizedQAP
- Files:
-
- 12 added
- 8 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab 3.3 Services.sln
r6659 r6733 18 18 EndProject 19 19 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.ProblemInstances-3.3", "HeuristicLab.Services.ProblemInstances\HeuristicLab.Services.ProblemInstances-3.3.csproj", "{D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}" 20 EndProject21 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.ProblemInstances.QAPInitializer", "HeuristicLab.Services.ProblemInstances.QAPInitializer\HeuristicLab.Services.ProblemInstances.QAPInitializer.csproj", "{BA6B5487-6CCA-4484-B196-13B68A45CBB5}"22 ProjectSection(ProjectDependencies) = postProject23 {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898} = {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}24 EndProjectSection25 20 EndProject 26 21 Global … … 99 94 {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}.Release|x64.ActiveCfg = Release|Any CPU 100 95 {D4E9242F-DAA4-4A15-8DE7-91CECFFFD898}.Release|x86.ActiveCfg = Release|Any CPU 101 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|Any CPU.ActiveCfg = Debug|x86102 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86103 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|Mixed Platforms.Build.0 = Debug|x86104 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|x64.ActiveCfg = Debug|x86105 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|x86.ActiveCfg = Debug|x86106 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Debug|x86.Build.0 = Debug|x86107 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|Any CPU.ActiveCfg = Release|x86108 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|Mixed Platforms.ActiveCfg = Release|x86109 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|Mixed Platforms.Build.0 = Release|x86110 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|x64.ActiveCfg = Release|x86111 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|x86.ActiveCfg = Release|x86112 {BA6B5487-6CCA-4484-B196-13B68A45CBB5}.Release|x86.Build.0 = Release|x86113 96 EndGlobalSection 114 97 GlobalSection(SolutionProperties) = preSolution -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/HeuristicLab.Problems.QuadraticAssignment.Views-3.3.csproj
r6659 r6733 154 154 <DependentUpon>Reference.svcmap</DependentUpon> 155 155 </None> 156 <None Include="Service References\QAPServiceReference\QAP.wsdl" />157 <None Include="Service References\QAPServiceReference\QAP.xsd">158 <SubType>Designer</SubType>159 </None>160 <None Include="Service References\QAPServiceReference\QAP1.xsd">161 <SubType>Designer</SubType>162 </None>163 <None Include="Service References\QAPServiceReference\QAP2.xsd">164 <SubType>Designer</SubType>165 </None>166 <None Include="Service References\QAPServiceReference\QAP3.xsd">167 <SubType>Designer</SubType>168 </None>169 156 </ItemGroup> 170 157 <ItemGroup> … … 232 219 </ItemGroup> 233 220 <ItemGroup> 234 <None Include="Service References\QAPServiceReference\QAP.disco" />235 </ItemGroup>236 <ItemGroup>237 221 <None Include="Service References\QAPServiceReference\configuration91.svcinfo" /> 238 222 </ItemGroup> … … 241 225 </ItemGroup> 242 226 <ItemGroup> 227 <None Include="Service References\QAPServiceReference\QAP1.wsdl" /> 228 <None Include="Service References\QAPServiceReference\QAP4.xsd"> 229 <SubType>Designer</SubType> 230 </None> 231 <None Include="Service References\QAPServiceReference\QAP41.xsd"> 232 <SubType>Designer</SubType> 233 </None> 234 <None Include="Service References\QAPServiceReference\QAP42.xsd"> 235 <SubType>Designer</SubType> 236 </None> 237 <None Include="Service References\QAPServiceReference\QAP43.xsd"> 238 <SubType>Designer</SubType> 239 </None> 243 240 <None Include="Service References\QAPServiceReference\Reference.svcmap"> 244 241 <Generator>WCF Proxy Generator</Generator> 245 242 <LastGenOutput>Reference.cs</LastGenOutput> 246 243 </None> 244 </ItemGroup> 245 <ItemGroup> 246 <None Include="Service References\QAPServiceReference\QAP1.disco" /> 247 247 </ItemGroup> 248 248 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs
r6660 r6733 23 23 using System.Drawing; 24 24 using System.Linq; 25 using System.Threading.Tasks; 25 26 using System.Windows.Forms; 26 27 using HeuristicLab.Common.Resources; … … 80 81 protected override void OnContentChanged() { 81 82 base.OnContentChanged(); 82 instancesComboBox.Items.Clear();83 83 if (Content != null) { 84 foreach (string instance in Content.EmbeddedInstances) {85 instancesComboBox.Items.Add(instance);86 }87 84 qapView.Distances = Content.Distances; 88 85 qapView.Weights = Content.Weights; … … 97 94 protected override void SetEnabledStateOfControls() { 98 95 base.SetEnabledStateOfControls(); 96 reloadInstancesButton.Enabled = !ReadOnly && !Locked && Content != null; 99 97 instancesComboBox.Enabled = !ReadOnly && !Locked && Content != null; 100 loadInstanceButton.Enabled = !ReadOnly && !Locked && Content != null && instancesComboBox.SelectedItem != null;98 loadInstanceButton.Enabled = !ReadOnly && !Locked && Content != null && !String.IsNullOrEmpty((string)instancesComboBox.SelectedItem); 101 99 importInstanceButton.Enabled = !ReadOnly && !Locked && Content != null; 102 100 } 103 101 104 102 private void instancesComboBox_SelectedValueChanged(object sender, System.EventArgs e) { 105 loadInstanceButton.Enabled = instancesComboBox.SelectedItem != null;103 SetEnabledStateOfControls(); 106 104 } 107 105 108 106 private void loadInstanceButton_Click(object sender, System.EventArgs e) { 109 string instance = instancesComboBox.SelectedItem as string; 110 try { 111 using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) { 112 var data = client.GetProblemInstanceData(instance); 113 DoubleMatrix weights = new DoubleMatrix(data.Weights.Length, data.Weights.Length); 114 DoubleMatrix distances = new DoubleMatrix(data.Weights.Length, data.Weights.Length); 115 try { 116 for (int i = 0; i < data.Weights.Length; i++) 117 for (int j = 0; j < data.Weights.Length; j++) { 118 weights[i, j] = data.Weights[i][j]; 119 distances[i, j] = data.Distances[i][j]; 107 ReadOnly = true; 108 string instanceStr = instancesComboBox.SelectedItem as string; 109 Task t = new Task((object name) => { 110 string instance = (string)name; 111 if (String.IsNullOrEmpty(instance)) return; 112 try { 113 using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) { 114 var data = client.GetProblemInstanceData(instance); 115 DoubleMatrix weights = new DoubleMatrix(data.Weights.Length, data.Weights.Length); 116 DoubleMatrix distances = new DoubleMatrix(data.Weights.Length, data.Weights.Length); 117 try { 118 for (int i = 0; i < data.Weights.Length; i++) 119 for (int j = 0; j < data.Weights.Length; j++) { 120 weights[i, j] = data.Weights[i][j]; 121 distances[i, j] = data.Distances[i][j]; 122 } 123 } catch (IndexOutOfRangeException) { 124 MessageBox.Show("The problem data is malformed, the problem could not be loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 125 } 126 Content.Name = data.Name; 127 Content.Description = data.Description; 128 Content.Maximization.Value = data.Maximization; 129 Content.Weights = weights; 130 Content.Distances = distances; 131 132 Content.BestKnownQualityParameter.Value = null; 133 Content.BestKnownSolution = null; 134 Content.BestKnownSolutions = new ItemSet<Permutation>(); 135 var solutions = client.GetBestSolutionsData(instance); 136 if (solutions.Any()) { 137 Content.BestKnownQualityParameter.Value = new DoubleValue(solutions.First().Quality); 138 Content.BestKnownSolution = new Permutation(PermutationTypes.Absolute, solutions.First().Assignment); 139 foreach (var solution in solutions) { 140 Content.BestKnownSolutions.Add(new Permutation(PermutationTypes.Absolute, solution.Assignment)); 120 141 } 121 } catch (IndexOutOfRangeException) {122 MessageBox.Show("The problem data is malformed, the problem could not be loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);123 }124 Content.Name = data.Name;125 Content.Description = data.Description;126 Content.Maximization.Value = data.Maximization;127 Content.Weights = weights;128 Content.Distances = distances;129 130 Content.BestKnownQualityParameter.Value = null;131 Content.BestKnownSolution = null;132 Content.BestKnownSolutions = new ItemSet<Permutation>();133 var solutions = client.GetBestSolutionsData(instance);134 if (solutions.Any()) {135 Content.BestKnownQualityParameter.Value = new DoubleValue(solutions.First().Quality);136 Content.BestKnownSolution = new Permutation(PermutationTypes.Absolute, solutions.First().Assignment);137 foreach (var solution in solutions) {138 Content.BestKnownSolutions.Add(new Permutation(PermutationTypes.Absolute, solution.Assignment));139 142 } 140 143 } 144 } catch (Exception ex) { 145 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); 146 } finally { 147 ReadOnly = false; 141 148 } 142 } catch (Exception ex) { 143 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); 144 } 149 }, instanceStr); 150 t.Start(); 145 151 } 146 152 … … 172 178 173 179 private void reloadInstancesButton_Click(object sender, EventArgs e) { 174 try { 175 using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) { 176 instancesComboBox.Items.Clear(); 177 foreach (string name in client.GetProblemInstances()) 178 instancesComboBox.Items.Add(name); 180 ReadOnly = true; 181 System.Threading.Tasks.Task t = new System.Threading.Tasks.Task(() => { 182 try { 183 using (QAPServiceReference.QAPClient client = new QAPServiceReference.QAPClient()) { 184 instancesComboBox.Items.Clear(); 185 foreach (string name in client.GetProblemInstances()) 186 instancesComboBox.Items.Add(name); 187 if (instancesComboBox.Items.Count > 0) 188 instancesComboBox.SelectedIndex = 0; 189 } 190 } catch (Exception ex) { 191 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); 192 } finally { 193 ReadOnly = false; 179 194 } 180 } catch (Exception ex) { 181 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); 182 } 195 }); 196 t.Start(); 183 197 } 184 198 } -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPInstanceDto.datasource
r6659 r6733 7 7 --> 8 8 <GenericObjectDataSource DisplayName="QAPInstanceDto" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> 9 <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPInstanceDto </TypeInfo>9 <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPInstanceDto, Service References.QAPServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> 10 10 </GenericObjectDataSource> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPSolutionDto.datasource
r6659 r6733 7 7 --> 8 8 <GenericObjectDataSource DisplayName="QAPSolutionDto" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> 9 <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPSolutionDto </TypeInfo>9 <TypeInfo>HeuristicLab.Problems.QuadraticAssignment.Views.QAPServiceReference.QAPSolutionDto, Service References.QAPServiceReference.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> 10 10 </GenericObjectDataSource> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/Reference.cs
r6659 r6733 24 24 25 25 [System.Runtime.Serialization.OptionalFieldAttribute()] 26 private double BestKnownQualityField; 27 28 [System.Runtime.Serialization.OptionalFieldAttribute()] 26 29 private string DescriptionField; 27 30 28 31 [System.Runtime.Serialization.OptionalFieldAttribute()] 29 32 private double[][] DistancesField; 33 34 [System.Runtime.Serialization.OptionalFieldAttribute()] 35 private bool HasBestKnownQualityField; 30 36 31 37 [System.Runtime.Serialization.OptionalFieldAttribute()] … … 45 51 set { 46 52 this.extensionDataField = value; 53 } 54 } 55 56 [System.Runtime.Serialization.DataMemberAttribute()] 57 public double BestKnownQuality { 58 get { 59 return this.BestKnownQualityField; 60 } 61 set { 62 if ((this.BestKnownQualityField.Equals(value) != true)) { 63 this.BestKnownQualityField = value; 64 this.RaisePropertyChanged("BestKnownQuality"); 65 } 47 66 } 48 67 } … … 70 89 this.DistancesField = value; 71 90 this.RaisePropertyChanged("Distances"); 91 } 92 } 93 } 94 95 [System.Runtime.Serialization.DataMemberAttribute()] 96 public bool HasBestKnownQuality { 97 get { 98 return this.HasBestKnownQualityField; 99 } 100 set { 101 if ((this.HasBestKnownQualityField.Equals(value) != true)) { 102 this.HasBestKnownQualityField = value; 103 this.RaisePropertyChanged("HasBestKnownQuality"); 72 104 } 73 105 } … … 136 168 137 169 [System.Runtime.Serialization.OptionalFieldAttribute()] 170 private bool AssignmentUndefinedField; 171 172 [System.Runtime.Serialization.OptionalFieldAttribute()] 138 173 private double QualityField; 139 174 … … 157 192 this.AssignmentField = value; 158 193 this.RaisePropertyChanged("Assignment"); 194 } 195 } 196 } 197 198 [System.Runtime.Serialization.DataMemberAttribute()] 199 public bool AssignmentUndefined { 200 get { 201 return this.AssignmentUndefinedField; 202 } 203 set { 204 if ((this.AssignmentUndefinedField.Equals(value) != true)) { 205 this.AssignmentUndefinedField = value; 206 this.RaisePropertyChanged("AssignmentUndefined"); 159 207 } 160 208 } -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/Reference.svcmap
r6659 r6733 19 19 </ClientOptions> 20 20 <MetadataSources> 21 <MetadataSource Address="http:// localhost:3978/QAP/QAP.svc" Protocol="http" SourceId="1" />21 <MetadataSource Address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" Protocol="http" SourceId="1" /> 22 22 </MetadataSources> 23 23 <Metadata> 24 <MetadataFile FileName="QAP .disco" MetadataType="Disco" ID="dea2bc2c-960b-40b9-94ce-8cffa4b02221" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?disco" />25 <MetadataFile FileName="QAP .wsdl" MetadataType="Wsdl" ID="ee1aab36-1ae6-4864-99de-d577d1f3de16" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?wsdl" />26 <MetadataFile FileName="QAP .xsd" MetadataType="Schema" ID="bf8e27bf-7807-41e0-8fe5-0941e9c0b93a" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd2" />27 <MetadataFile FileName="QAP 1.xsd" MetadataType="Schema" ID="4dc00ff5-082c-49a3-b956-0af89ccfc448" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd3" />28 <MetadataFile FileName="QAP 2.xsd" MetadataType="Schema" ID="d883e2c7-abf6-4c20-8d60-23f417b40561" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd0" />29 <MetadataFile FileName="QAP 3.xsd" MetadataType="Schema" ID="c86fad99-c0cb-4ce6-9318-38797ba97040" SourceId="1" SourceUrl="http://localhost:3978/QAP/QAP.svc?xsd=xsd1" />24 <MetadataFile FileName="QAP1.disco" MetadataType="Disco" ID="b15b4f39-21ff-4118-8aff-d2a421e1d163" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?disco" /> 25 <MetadataFile FileName="QAP1.wsdl" MetadataType="Wsdl" ID="d88dc4ea-2680-476d-8346-80a59c48b187" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?wsdl" /> 26 <MetadataFile FileName="QAP4.xsd" MetadataType="Schema" ID="6aad67b2-97c7-4a32-9cfd-8475ebf3060c" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd3" /> 27 <MetadataFile FileName="QAP41.xsd" MetadataType="Schema" ID="457c09d3-5cf2-410c-beab-4c8187c62d98" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd0" /> 28 <MetadataFile FileName="QAP42.xsd" MetadataType="Schema" ID="51f1963a-e89f-4e57-8253-252e9d21feca" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd2" /> 29 <MetadataFile FileName="QAP43.xsd" MetadataType="Schema" ID="6adc07a9-4704-4ad0-b2cd-f304b65ee30d" SourceId="1" SourceUrl="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc?xsd=xsd1" /> 30 30 </Metadata> 31 31 <Extensions> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/configuration.svcinfo
r6659 r6733 6 6 </bindings> 7 7 <endpoints> 8 <endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="http:// localhost:3978/QAP/QAP.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />" digest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost:3978/QAP/QAP.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />" contractName="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />8 <endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />" digest="<?xml version="1.0" encoding="utf-16"?><Data address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" />" contractName="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" /> 9 9 </endpoints> 10 10 </configurationSnapshot> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/Service References/QAPServiceReference/configuration91.svcinfo
r6659 r6733 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum=" PGSA1ejV32Fh0z8GmGBf7NFeB0w=">2 <SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="Ik4GzQEYPImjtoibudTmBx1Uums="> 3 3 <bindingConfigurations> 4 4 <bindingConfiguration bindingType="basicHttpBinding" name="BasicHttpBinding_IQAP"> … … 113 113 </bindingConfigurations> 114 114 <endpoints> 115 <endpoint name="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" bindingType="basicHttpBinding" address="http:// localhost:3978/QAP/QAP.svc" bindingConfiguration="BasicHttpBinding_IQAP">115 <endpoint name="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" bindingType="basicHttpBinding" address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" bindingConfiguration="BasicHttpBinding_IQAP"> 116 116 <properties> 117 117 <property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 118 <serializedValue>http:// localhost:3978/QAP/QAP.svc</serializedValue>118 <serializedValue>http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc</serializedValue> 119 119 </property> 120 120 <property path="/behaviorConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/app.config
r6659 r6733 2 2 <configuration> 3 3 <system.serviceModel> 4 <behaviors> 5 <endpointBehaviors> 6 <behavior name="ProblemInstancesLargeMessages"> 7 <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 8 </behavior> 9 </endpointBehaviors> 10 </behaviors> 4 11 <bindings> 5 12 <basicHttpBinding> … … 7 14 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 8 15 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 9 maxBufferSize=" 65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"16 maxBufferSize="16777216" maxBufferPoolSize="524288" maxReceivedMessageSize="16777216" 10 17 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 11 18 useDefaultWebProxy="true"> 12 <readerQuotas maxDepth=" 32" maxStringContentLength="8192" maxArrayLength="16384"13 maxBytesPerRead=" 4096" maxNameTableCharCount="16384" />19 <readerQuotas maxDepth="512" maxStringContentLength="1048576" maxArrayLength="1048576" 20 maxBytesPerRead="8192" maxNameTableCharCount="16384" /> 14 21 <security mode="None"> 15 22 <transport clientCredentialType="None" proxyCredentialType="None" … … 21 28 </bindings> 22 29 <client> 23 <endpoint address="http://localhost:3978/QAP/QAP.svc" binding="basicHttpBinding" 24 bindingConfiguration="BasicHttpBinding_IQAP" contract="QAPServiceReference.IQAP" 25 name="BasicHttpBinding_IQAP" /> 30 <endpoint address="http://services.heuristiclab.com/ProblemInstances-3.3/QAP/QAP.svc" 31 binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IQAP" 32 behaviorConfiguration="ProblemInstancesLargeMessages" 33 contract="QAPServiceReference.IQAP" name="BasicHttpBinding_IQAP" /> 26 34 </client> 27 35 </system.serviceModel> -
branches/GeneralizedQAP/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj
r6685 r6733 233 233 <EmbeddedResource Include="Data\tai100a.dat" /> 234 234 <EmbeddedResource Include="Data\tai100b.dat" /> 235 <EmbeddedResource Include="Data\tai10a.dat" />236 <EmbeddedResource Include="Data\tai10b.dat" />237 235 <EmbeddedResource Include="Data\tai12a.dat" /> 238 236 <EmbeddedResource Include="Data\tai12b.dat" /> -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances.QAPInitializer/Program.cs
r6659 r6733 1 1 using System; 2 using System.Linq; 2 3 using System.Text; 3 4 using HeuristicLab.Problems.QuadraticAssignment; … … 10 11 foreach (string instance in qap.EmbeddedInstances) { 11 12 qap.LoadEmbeddedInstance(instance); 12 // transform matrices into jagged arrays 13 double[][] weights = new double[qap.Weights.Rows][]; 14 double[][] distances = new double[qap.Weights.Rows][]; 15 for (int i = 0; i < weights.Length; i++) { 16 weights[i] = new double[weights.Length]; 17 distances[i] = new double[weights.Length]; 18 for (int j = 0; j < weights.Length; j++) { 19 weights[i][j] = qap.Weights[i, j]; 20 distances[i][j] = qap.Distances[i, j]; 13 // transform DoubleMatrix into multidimensional array 14 double[,] weights = new double[qap.Weights.Rows, qap.Weights.Columns]; 15 double[,] distances = new double[qap.Distances.Rows, qap.Distances.Columns]; 16 for (int i = 0; i < weights.GetLength(0); i++) { 17 for (int j = 0; j < weights.GetLength(1); j++) { 18 weights[i, j] = qap.Weights[i, j]; 19 distances[i, j] = qap.Distances[i, j]; 21 20 } 22 21 } 23 22 24 23 QAPInstance dbInstance = context.CreateObject<QAPInstance>(); 25 dbInstance.name = qap.Name; 26 dbInstance.description = qap.Description; 27 dbInstance.maximization = qap.Maximization.Value; 28 dbInstance.weights = PrimitiveSerializer.SerializeDoubleMatrix(weights); 29 dbInstance.weights_sha1 = GetSHA1Hash(dbInstance.weights); 30 dbInstance.distances = PrimitiveSerializer.SerializeDoubleMatrix(distances); 31 dbInstance.distances_sha1 = GetSHA1Hash(dbInstance.distances); 32 dbInstance.problemsize = qap.Weights.Rows; 24 dbInstance.Name = qap.Name; 25 dbInstance.Description = qap.Description; 26 dbInstance.Maximization = qap.Maximization.Value; 27 dbInstance.Weights = SimpleSerializer.SerializeDoubleMatrix(weights); 28 dbInstance.WeightsHash = GetSHA1Hash(dbInstance.Weights); 29 dbInstance.Distances = SimpleSerializer.SerializeDoubleMatrix(distances); 30 dbInstance.DistancesHash = GetSHA1Hash(dbInstance.Distances); 31 dbInstance.ProblemSize = qap.Weights.Rows; 32 context.QAPInstances.AddObject(dbInstance); 33 33 34 context.QAPInstances.AddObject(dbInstance); 34 if (qap.BestKnownQuality != null) { 35 QAPSolution dbSolution = context.CreateObject<QAPSolution>(); 36 if (qap.BestKnownSolution != null) { 37 dbSolution.Assignment = SimpleSerializer.SerializeIntArray(qap.BestKnownSolution.ToArray()); 38 dbSolution.AssignmentHash = GetSHA1Hash(dbSolution.Assignment); 39 } 40 dbSolution.Instance = dbInstance; 41 dbSolution.Quality = qap.BestKnownQuality.Value; 42 context.QAPSolutions.AddObject(dbSolution); 43 } 35 44 } 36 45 context.SaveChanges(); -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances.QAPInitializer/app.config
r6659 r6733 6 6 </system.serviceModel> 7 7 <connectionStrings> 8 <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MRPINK\SQLEXPRESS;Initial Catalog= ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />8 <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MRPINK\SQLEXPRESS;Initial Catalog=HeuristicLab.ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> 9 9 </connectionStrings> 10 10 </configuration> -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/HeuristicLab.Services.ProblemInstances-3.3.csproj
r6659 r6733 23 23 <ErrorReport>prompt</ErrorReport> 24 24 <WarningLevel>4</WarningLevel> 25 <PublishDatabaseSettings> 26 <Objects> 27 <ObjectGroup Name="ProblemInstancesEntities-Deployment" Order="1"> 28 <Destination Path="" /> 29 <Object Type="dbFullSql"> 30 <PreSource Path="Data Source=LOCALHOST\SQLEXPRESS%3bInitial Catalog=HeuristicLab.ProblemInstances%3bIntegrated Security=True%3bPooling=False" ScriptSchema="True" ScriptData="False" CopyAllFullTextCatalogs="False" /> 31 <Source Path="obj\Debug\AutoScripts\ProblemInstancesEntities-Deployment_SchemaOnly.sql" Transacted="True" /> 32 </Object> 33 </ObjectGroup> 34 </Objects> 35 </PublishDatabaseSettings> 36 <ExcludeGeneratedDebugSymbol>false</ExcludeGeneratedDebugSymbol> 25 37 </PropertyGroup> 26 38 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 31 43 <ErrorReport>prompt</ErrorReport> 32 44 <WarningLevel>4</WarningLevel> 45 <PublishDatabaseSettings> 46 <Objects> 47 </Objects> 48 </PublishDatabaseSettings> 49 <ExcludeGeneratedDebugSymbol>true</ExcludeGeneratedDebugSymbol> 50 </PropertyGroup> 51 <PropertyGroup> 52 <SignAssembly>true</SignAssembly> 53 </PropertyGroup> 54 <PropertyGroup> 55 <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile> 33 56 </PropertyGroup> 34 57 <ItemGroup> … … 55 78 </ItemGroup> 56 79 <ItemGroup> 80 <None Include="QAP\Initial.sql" /> 57 81 <Content Include="QAP\QAP.svc" /> 58 <Content Include="Web.config" /> 82 <Content Include="Web.config"> 83 <SubType>Designer</SubType> 84 </Content> 59 85 <Content Include="Web.Debug.config"> 60 86 <DependentUpon>Web.config</DependentUpon> … … 69 95 <LastGenOutput>ProblemInstancesModel.Designer.cs</LastGenOutput> 70 96 </EntityDeploy> 97 <None Include="HeuristicLab.snk" /> 71 98 <None Include="Properties\AssemblyInfo.frame" /> 72 <Compile Include="PrimitiveSerializationException.cs" /> 73 <Compile Include="PrimitiveSerializer.cs" /> 99 <Compile Include="Auxiliary.cs" /> 100 <Compile Include="SimpleSerializationException.cs" /> 101 <Compile Include="SimpleSerializer.cs" /> 74 102 <Compile Include="ProblemInstancesModel.Designer.cs"> 75 103 <AutoGen>True</AutoGen> -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/ProblemInstancesModel.Designer.cs
r6659 r6733 19 19 #region EDM Relationship Metadata 20 20 21 [assembly: EdmRelationshipAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance ", "QAPInstance", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(HeuristicLab.Services.ProblemInstances.QAPInstance), "QAPSolution", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(HeuristicLab.Services.ProblemInstances.QAPSolution), true)]21 [assembly: EdmRelationshipAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance1", "QAPInstance", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(HeuristicLab.Services.ProblemInstances.QAPInstance), "QAPSolution", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(HeuristicLab.Services.ProblemInstances.QAPSolution), true)] 22 22 23 23 #endregion … … 143 143 /// Create a new QAPInstance object. 144 144 /// </summary> 145 /// <param name="name">Initial value of the name property.</param>146 /// <param name="maximization">Initial value of the maximization property.</param>147 /// <param name="weights">Initial value of the weights property.</param>148 /// <param name="weights _sha1">Initial value of the weights_sha1property.</param>149 /// <param name="distances">Initial value of the distances property.</param>150 /// <param name="distances _sha1">Initial value of the distances_sha1property.</param>151 /// <param name="problem size">Initial value of the problemsize property.</param>152 public static QAPInstance CreateQAPInstance(global::System.String name, global::System.Boolean maximization, global::System.String weights, global::System.String weights _sha1, global::System.String distances, global::System.String distances_sha1, global::System.Int32 problemsize)145 /// <param name="name">Initial value of the Name property.</param> 146 /// <param name="maximization">Initial value of the Maximization property.</param> 147 /// <param name="weights">Initial value of the Weights property.</param> 148 /// <param name="weightsHash">Initial value of the WeightsHash property.</param> 149 /// <param name="distances">Initial value of the Distances property.</param> 150 /// <param name="distancesHash">Initial value of the DistancesHash property.</param> 151 /// <param name="problemSize">Initial value of the ProblemSize property.</param> 152 public static QAPInstance CreateQAPInstance(global::System.String name, global::System.Boolean maximization, global::System.String weights, global::System.String weightsHash, global::System.String distances, global::System.String distancesHash, global::System.Int32 problemSize) 153 153 { 154 154 QAPInstance qAPInstance = new QAPInstance(); 155 qAPInstance. name = name;156 qAPInstance. maximization = maximization;157 qAPInstance. weights = weights;158 qAPInstance. weights_sha1 = weights_sha1;159 qAPInstance. distances = distances;160 qAPInstance. distances_sha1 = distances_sha1;161 qAPInstance. problemsize = problemsize;155 qAPInstance.Name = name; 156 qAPInstance.Maximization = maximization; 157 qAPInstance.Weights = weights; 158 qAPInstance.WeightsHash = weightsHash; 159 qAPInstance.Distances = distances; 160 qAPInstance.DistancesHash = distancesHash; 161 qAPInstance.ProblemSize = problemSize; 162 162 return qAPInstance; 163 163 } … … 171 171 [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] 172 172 [DataMemberAttribute()] 173 public global::System.String name174 { 175 get 176 { 177 return _ name;178 } 179 set 180 { 181 if (_ name != value)173 public global::System.String Name 174 { 175 get 176 { 177 return _Name; 178 } 179 set 180 { 181 if (_Name != value) 182 182 { 183 On nameChanging(value);184 ReportPropertyChanging(" name");185 _ name = StructuralObject.SetValidValue(value, false);186 ReportPropertyChanged(" name");187 On nameChanged();183 OnNameChanging(value); 184 ReportPropertyChanging("Name"); 185 _Name = StructuralObject.SetValidValue(value, false); 186 ReportPropertyChanged("Name"); 187 OnNameChanged(); 188 188 } 189 189 } 190 190 } 191 private global::System.String _ name;192 partial void On nameChanging(global::System.String value);193 partial void On nameChanged();191 private global::System.String _Name; 192 partial void OnNameChanging(global::System.String value); 193 partial void OnNameChanged(); 194 194 195 195 /// <summary> … … 198 198 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] 199 199 [DataMemberAttribute()] 200 public global::System.String description201 { 202 get 203 { 204 return _ description;205 } 206 set 207 { 208 On descriptionChanging(value);209 ReportPropertyChanging(" description");210 _ description = StructuralObject.SetValidValue(value, true);211 ReportPropertyChanged(" description");212 On descriptionChanged();213 } 214 } 215 private global::System.String _ description;216 partial void On descriptionChanging(global::System.String value);217 partial void On descriptionChanged();218 219 /// <summary> 220 /// No Metadata Documentation available. 221 /// </summary> 222 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 223 [DataMemberAttribute()] 224 public global::System.Boolean maximization225 { 226 get 227 { 228 return _ maximization;229 } 230 set 231 { 232 On maximizationChanging(value);233 ReportPropertyChanging(" maximization");234 _ maximization = StructuralObject.SetValidValue(value);235 ReportPropertyChanged(" maximization");236 On maximizationChanged();237 } 238 } 239 private global::System.Boolean _ maximization;240 partial void On maximizationChanging(global::System.Boolean value);241 partial void On maximizationChanged();242 243 /// <summary> 244 /// No Metadata Documentation available. 245 /// </summary> 246 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 247 [DataMemberAttribute()] 248 public global::System.String weights249 { 250 get 251 { 252 return _ weights;253 } 254 set 255 { 256 On weightsChanging(value);257 ReportPropertyChanging(" weights");258 _ weights = StructuralObject.SetValidValue(value, false);259 ReportPropertyChanged(" weights");260 On weightsChanged();261 } 262 } 263 private global::System.String _ weights;264 partial void On weightsChanging(global::System.String value);265 partial void On weightsChanged();266 267 /// <summary> 268 /// No Metadata Documentation available. 269 /// </summary> 270 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 271 [DataMemberAttribute()] 272 public global::System.String weights_sha1273 { 274 get 275 { 276 return _ weights_sha1;277 } 278 set 279 { 280 On weights_sha1Changing(value);281 ReportPropertyChanging(" weights_sha1");282 _ weights_sha1= StructuralObject.SetValidValue(value, false);283 ReportPropertyChanged(" weights_sha1");284 On weights_sha1Changed();285 } 286 } 287 private global::System.String _ weights_sha1;288 partial void On weights_sha1Changing(global::System.String value);289 partial void On weights_sha1Changed();290 291 /// <summary> 292 /// No Metadata Documentation available. 293 /// </summary> 294 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 295 [DataMemberAttribute()] 296 public global::System.String distances297 { 298 get 299 { 300 return _ distances;301 } 302 set 303 { 304 On distancesChanging(value);305 ReportPropertyChanging(" distances");306 _ distances = StructuralObject.SetValidValue(value, false);307 ReportPropertyChanged(" distances");308 On distancesChanged();309 } 310 } 311 private global::System.String _ distances;312 partial void On distancesChanging(global::System.String value);313 partial void On distancesChanged();314 315 /// <summary> 316 /// No Metadata Documentation available. 317 /// </summary> 318 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 319 [DataMemberAttribute()] 320 public global::System.String distances_sha1321 { 322 get 323 { 324 return _ distances_sha1;325 } 326 set 327 { 328 On distances_sha1Changing(value);329 ReportPropertyChanging(" distances_sha1");330 _ distances_sha1= StructuralObject.SetValidValue(value, false);331 ReportPropertyChanged(" distances_sha1");332 On distances_sha1Changed();333 } 334 } 335 private global::System.String _ distances_sha1;336 partial void On distances_sha1Changing(global::System.String value);337 partial void On distances_sha1Changed();338 339 /// <summary> 340 /// No Metadata Documentation available. 341 /// </summary> 342 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 343 [DataMemberAttribute()] 344 public global::System.Int32 problemsize345 { 346 get 347 { 348 return _ problemsize;349 } 350 set 351 { 352 On problemsizeChanging(value);353 ReportPropertyChanging(" problemsize");354 _ problemsize = StructuralObject.SetValidValue(value);355 ReportPropertyChanged(" problemsize");356 On problemsizeChanged();357 } 358 } 359 private global::System.Int32 _ problemsize;360 partial void On problemsizeChanging(global::System.Int32 value);361 partial void On problemsizeChanged();200 public global::System.String Description 201 { 202 get 203 { 204 return _Description; 205 } 206 set 207 { 208 OnDescriptionChanging(value); 209 ReportPropertyChanging("Description"); 210 _Description = StructuralObject.SetValidValue(value, true); 211 ReportPropertyChanged("Description"); 212 OnDescriptionChanged(); 213 } 214 } 215 private global::System.String _Description; 216 partial void OnDescriptionChanging(global::System.String value); 217 partial void OnDescriptionChanged(); 218 219 /// <summary> 220 /// No Metadata Documentation available. 221 /// </summary> 222 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 223 [DataMemberAttribute()] 224 public global::System.Boolean Maximization 225 { 226 get 227 { 228 return _Maximization; 229 } 230 set 231 { 232 OnMaximizationChanging(value); 233 ReportPropertyChanging("Maximization"); 234 _Maximization = StructuralObject.SetValidValue(value); 235 ReportPropertyChanged("Maximization"); 236 OnMaximizationChanged(); 237 } 238 } 239 private global::System.Boolean _Maximization; 240 partial void OnMaximizationChanging(global::System.Boolean value); 241 partial void OnMaximizationChanged(); 242 243 /// <summary> 244 /// No Metadata Documentation available. 245 /// </summary> 246 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 247 [DataMemberAttribute()] 248 public global::System.String Weights 249 { 250 get 251 { 252 return _Weights; 253 } 254 set 255 { 256 OnWeightsChanging(value); 257 ReportPropertyChanging("Weights"); 258 _Weights = StructuralObject.SetValidValue(value, false); 259 ReportPropertyChanged("Weights"); 260 OnWeightsChanged(); 261 } 262 } 263 private global::System.String _Weights; 264 partial void OnWeightsChanging(global::System.String value); 265 partial void OnWeightsChanged(); 266 267 /// <summary> 268 /// No Metadata Documentation available. 269 /// </summary> 270 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 271 [DataMemberAttribute()] 272 public global::System.String WeightsHash 273 { 274 get 275 { 276 return _WeightsHash; 277 } 278 set 279 { 280 OnWeightsHashChanging(value); 281 ReportPropertyChanging("WeightsHash"); 282 _WeightsHash = StructuralObject.SetValidValue(value, false); 283 ReportPropertyChanged("WeightsHash"); 284 OnWeightsHashChanged(); 285 } 286 } 287 private global::System.String _WeightsHash; 288 partial void OnWeightsHashChanging(global::System.String value); 289 partial void OnWeightsHashChanged(); 290 291 /// <summary> 292 /// No Metadata Documentation available. 293 /// </summary> 294 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 295 [DataMemberAttribute()] 296 public global::System.String Distances 297 { 298 get 299 { 300 return _Distances; 301 } 302 set 303 { 304 OnDistancesChanging(value); 305 ReportPropertyChanging("Distances"); 306 _Distances = StructuralObject.SetValidValue(value, false); 307 ReportPropertyChanged("Distances"); 308 OnDistancesChanged(); 309 } 310 } 311 private global::System.String _Distances; 312 partial void OnDistancesChanging(global::System.String value); 313 partial void OnDistancesChanged(); 314 315 /// <summary> 316 /// No Metadata Documentation available. 317 /// </summary> 318 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 319 [DataMemberAttribute()] 320 public global::System.String DistancesHash 321 { 322 get 323 { 324 return _DistancesHash; 325 } 326 set 327 { 328 OnDistancesHashChanging(value); 329 ReportPropertyChanging("DistancesHash"); 330 _DistancesHash = StructuralObject.SetValidValue(value, false); 331 ReportPropertyChanged("DistancesHash"); 332 OnDistancesHashChanged(); 333 } 334 } 335 private global::System.String _DistancesHash; 336 partial void OnDistancesHashChanging(global::System.String value); 337 partial void OnDistancesHashChanged(); 338 339 /// <summary> 340 /// No Metadata Documentation available. 341 /// </summary> 342 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 343 [DataMemberAttribute()] 344 public global::System.Int32 ProblemSize 345 { 346 get 347 { 348 return _ProblemSize; 349 } 350 set 351 { 352 OnProblemSizeChanging(value); 353 ReportPropertyChanging("ProblemSize"); 354 _ProblemSize = StructuralObject.SetValidValue(value); 355 ReportPropertyChanged("ProblemSize"); 356 OnProblemSizeChanged(); 357 } 358 } 359 private global::System.Int32 _ProblemSize; 360 partial void OnProblemSizeChanging(global::System.Int32 value); 361 partial void OnProblemSizeChanged(); 362 362 363 363 #endregion … … 371 371 [SoapIgnoreAttribute()] 372 372 [DataMemberAttribute()] 373 [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance ", "QAPSolution")]374 public EntityCollection<QAPSolution> QAPSolutions375 { 376 get 377 { 378 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance ", "QAPSolution");373 [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance1", "QAPSolution")] 374 public EntityCollection<QAPSolution> Solutions 375 { 376 get 377 { 378 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPSolution"); 379 379 } 380 380 set … … 382 382 if ((value != null)) 383 383 { 384 ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance ", "QAPSolution", value);384 ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<QAPSolution>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPSolution", value); 385 385 } 386 386 } … … 403 403 /// Create a new QAPSolution object. 404 404 /// </summary> 405 /// <param name="id">Initial value of the id property.</param>406 /// <param name="name">Initial value of the name property.</param>407 /// <param name="assignment">Initial value of the assignment property.</param>408 /// <param name="assignment _sha1">Initial value of the assignment_sha1property.</param>409 /// <param name="quality">Initial value of the quality property.</param>410 public static QAPSolution CreateQAPSolution(global::System.Int32 id, global::System.String name, global::System.String assignment, global::System.String assignment _sha1, global::System.Double quality)405 /// <param name="id">Initial value of the Id property.</param> 406 /// <param name="name">Initial value of the Name property.</param> 407 /// <param name="assignment">Initial value of the Assignment property.</param> 408 /// <param name="assignmentHash">Initial value of the AssignmentHash property.</param> 409 /// <param name="quality">Initial value of the Quality property.</param> 410 public static QAPSolution CreateQAPSolution(global::System.Int32 id, global::System.String name, global::System.String assignment, global::System.String assignmentHash, global::System.Double quality) 411 411 { 412 412 QAPSolution qAPSolution = new QAPSolution(); 413 qAPSolution. id = id;414 qAPSolution. name = name;415 qAPSolution. assignment = assignment;416 qAPSolution. assignment_sha1 = assignment_sha1;417 qAPSolution. quality = quality;413 qAPSolution.Id = id; 414 qAPSolution.Name = name; 415 qAPSolution.Assignment = assignment; 416 qAPSolution.AssignmentHash = assignmentHash; 417 qAPSolution.Quality = quality; 418 418 return qAPSolution; 419 419 } … … 427 427 [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] 428 428 [DataMemberAttribute()] 429 public global::System.Int32 id430 { 431 get 432 { 433 return _ id;434 } 435 set 436 { 437 if (_ id != value)429 public global::System.Int32 Id 430 { 431 get 432 { 433 return _Id; 434 } 435 set 436 { 437 if (_Id != value) 438 438 { 439 On idChanging(value);440 ReportPropertyChanging(" id");441 _ id = StructuralObject.SetValidValue(value);442 ReportPropertyChanged(" id");443 On idChanged();439 OnIdChanging(value); 440 ReportPropertyChanging("Id"); 441 _Id = StructuralObject.SetValidValue(value); 442 ReportPropertyChanged("Id"); 443 OnIdChanged(); 444 444 } 445 445 } 446 446 } 447 private global::System.Int32 _ id;448 partial void On idChanging(global::System.Int32 value);449 partial void On idChanged();450 451 /// <summary> 452 /// No Metadata Documentation available. 453 /// </summary> 454 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 455 [DataMemberAttribute()] 456 public global::System.String name457 { 458 get 459 { 460 return _ name;461 } 462 set 463 { 464 On nameChanging(value);465 ReportPropertyChanging(" name");466 _ name = StructuralObject.SetValidValue(value, false);467 ReportPropertyChanged(" name");468 On nameChanged();469 } 470 } 471 private global::System.String _ name;472 partial void On nameChanging(global::System.String value);473 partial void On nameChanged();474 475 /// <summary> 476 /// No Metadata Documentation available. 477 /// </summary> 478 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 479 [DataMemberAttribute()] 480 public global::System.String assignment481 { 482 get 483 { 484 return _ assignment;485 } 486 set 487 { 488 On assignmentChanging(value);489 ReportPropertyChanging(" assignment");490 _ assignment = StructuralObject.SetValidValue(value, false);491 ReportPropertyChanged(" assignment");492 On assignmentChanged();493 } 494 } 495 private global::System.String _ assignment;496 partial void On assignmentChanging(global::System.String value);497 partial void On assignmentChanged();498 499 /// <summary> 500 /// No Metadata Documentation available. 501 /// </summary> 502 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 503 [DataMemberAttribute()] 504 public global::System.String assignment_sha1505 { 506 get 507 { 508 return _ assignment_sha1;509 } 510 set 511 { 512 On assignment_sha1Changing(value);513 ReportPropertyChanging(" assignment_sha1");514 _ assignment_sha1= StructuralObject.SetValidValue(value, false);515 ReportPropertyChanged(" assignment_sha1");516 On assignment_sha1Changed();517 } 518 } 519 private global::System.String _ assignment_sha1;520 partial void On assignment_sha1Changing(global::System.String value);521 partial void On assignment_sha1Changed();522 523 /// <summary> 524 /// No Metadata Documentation available. 525 /// </summary> 526 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 527 [DataMemberAttribute()] 528 public global::System.Double quality529 { 530 get 531 { 532 return _ quality;533 } 534 set 535 { 536 On qualityChanging(value);537 ReportPropertyChanging(" quality");538 _ quality = StructuralObject.SetValidValue(value);539 ReportPropertyChanged(" quality");540 On qualityChanged();541 } 542 } 543 private global::System.Double _ quality;544 partial void On qualityChanging(global::System.Double value);545 partial void On qualityChanged();447 private global::System.Int32 _Id; 448 partial void OnIdChanging(global::System.Int32 value); 449 partial void OnIdChanged(); 450 451 /// <summary> 452 /// No Metadata Documentation available. 453 /// </summary> 454 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 455 [DataMemberAttribute()] 456 public global::System.String Name 457 { 458 get 459 { 460 return _Name; 461 } 462 set 463 { 464 OnNameChanging(value); 465 ReportPropertyChanging("Name"); 466 _Name = StructuralObject.SetValidValue(value, false); 467 ReportPropertyChanged("Name"); 468 OnNameChanged(); 469 } 470 } 471 private global::System.String _Name; 472 partial void OnNameChanging(global::System.String value); 473 partial void OnNameChanged(); 474 475 /// <summary> 476 /// No Metadata Documentation available. 477 /// </summary> 478 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 479 [DataMemberAttribute()] 480 public global::System.String Assignment 481 { 482 get 483 { 484 return _Assignment; 485 } 486 set 487 { 488 OnAssignmentChanging(value); 489 ReportPropertyChanging("Assignment"); 490 _Assignment = StructuralObject.SetValidValue(value, false); 491 ReportPropertyChanged("Assignment"); 492 OnAssignmentChanged(); 493 } 494 } 495 private global::System.String _Assignment; 496 partial void OnAssignmentChanging(global::System.String value); 497 partial void OnAssignmentChanged(); 498 499 /// <summary> 500 /// No Metadata Documentation available. 501 /// </summary> 502 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 503 [DataMemberAttribute()] 504 public global::System.String AssignmentHash 505 { 506 get 507 { 508 return _AssignmentHash; 509 } 510 set 511 { 512 OnAssignmentHashChanging(value); 513 ReportPropertyChanging("AssignmentHash"); 514 _AssignmentHash = StructuralObject.SetValidValue(value, false); 515 ReportPropertyChanged("AssignmentHash"); 516 OnAssignmentHashChanged(); 517 } 518 } 519 private global::System.String _AssignmentHash; 520 partial void OnAssignmentHashChanging(global::System.String value); 521 partial void OnAssignmentHashChanged(); 522 523 /// <summary> 524 /// No Metadata Documentation available. 525 /// </summary> 526 [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] 527 [DataMemberAttribute()] 528 public global::System.Double Quality 529 { 530 get 531 { 532 return _Quality; 533 } 534 set 535 { 536 OnQualityChanging(value); 537 ReportPropertyChanging("Quality"); 538 _Quality = StructuralObject.SetValidValue(value); 539 ReportPropertyChanged("Quality"); 540 OnQualityChanged(); 541 } 542 } 543 private global::System.Double _Quality; 544 partial void OnQualityChanging(global::System.Double value); 545 partial void OnQualityChanged(); 546 546 547 547 #endregion … … 555 555 [SoapIgnoreAttribute()] 556 556 [DataMemberAttribute()] 557 [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance ", "QAPInstance")]558 public QAPInstance QAPInstance559 { 560 get 561 { 562 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance ", "QAPInstance").Value;563 } 564 set 565 { 566 ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance ", "QAPInstance").Value = value;557 [EdmRelationshipNavigationPropertyAttribute("ProblemInstancesModel", "FK_QAPSolution_QAPInstance1", "QAPInstance")] 558 public QAPInstance Instance 559 { 560 get 561 { 562 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance").Value; 563 } 564 set 565 { 566 ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance").Value = value; 567 567 } 568 568 } … … 572 572 [BrowsableAttribute(false)] 573 573 [DataMemberAttribute()] 574 public EntityReference<QAPInstance> QAPInstanceReference575 { 576 get 577 { 578 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance ", "QAPInstance");574 public EntityReference<QAPInstance> InstanceReference 575 { 576 get 577 { 578 return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance"); 579 579 } 580 580 set … … 582 582 if ((value != null)) 583 583 { 584 ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance ", "QAPInstance", value);584 ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<QAPInstance>("ProblemInstancesModel.FK_QAPSolution_QAPInstance1", "QAPInstance", value); 585 585 } 586 586 } -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/ProblemInstancesModel.edmx
r6659 r6733 5 5 <!-- SSDL content --> 6 6 <edmx:StorageModels> 7 7 <Schema Namespace="ProblemInstancesModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl"> 8 8 <EntityContainer Name="ProblemInstancesModelStoreContainer"> 9 9 <EntitySet Name="QAPInstance" EntityType="ProblemInstancesModel.Store.QAPInstance" store:Type="Tables" Schema="dbo" /> … … 16 16 <EntityType Name="QAPInstance"> 17 17 <Key> 18 <PropertyRef Name=" name" />18 <PropertyRef Name="Name" /> 19 19 </Key> 20 <Property Name=" name" Type="nvarchar" Nullable="false" MaxLength="64" />21 <Property Name=" description" Type="ntext" />22 <Property Name=" maximization" Type="bit" Nullable="false" />23 <Property Name=" weights" Type="text" Nullable="false" />24 <Property Name=" weights_sha1" Type="char" Nullable="false" MaxLength="40" />25 <Property Name=" distances" Type="text" Nullable="false" />26 <Property Name=" distances_sha1" Type="char" Nullable="false" MaxLength="40" />27 <Property Name=" problemsize" Type="int" Nullable="false" />20 <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="64" /> 21 <Property Name="Description" Type="ntext" /> 22 <Property Name="Maximization" Type="bit" Nullable="false" /> 23 <Property Name="Weights" Type="varchar(max)" Nullable="false" /> 24 <Property Name="WeightsHash" Type="char" Nullable="false" MaxLength="40" /> 25 <Property Name="Distances" Type="varchar(max)" Nullable="false" /> 26 <Property Name="DistancesHash" Type="char" Nullable="false" MaxLength="40" /> 27 <Property Name="ProblemSize" Type="int" Nullable="false" /> 28 28 </EntityType> 29 29 <EntityType Name="QAPSolution"> 30 30 <Key> 31 <PropertyRef Name=" id" />31 <PropertyRef Name="Id" /> 32 32 </Key> 33 <Property Name=" id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />34 <Property Name=" name" Type="nvarchar" Nullable="false" MaxLength="64" />35 <Property Name=" assignment" Type="text" Nullable="false" />36 <Property Name=" assignment_sha1" Type="char" Nullable="false" MaxLength="40" />37 <Property Name=" quality" Type="float" Nullable="false" />33 <Property Name="Id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> 34 <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="64" /> 35 <Property Name="Assignment" Type="text" /> 36 <Property Name="AssignmentHash" Type="char" MaxLength="40" /> 37 <Property Name="Quality" Type="float" Nullable="false" /> 38 38 </EntityType> 39 39 <Association Name="FK_QAPSolution_QAPInstance"> … … 44 44 <ReferentialConstraint> 45 45 <Principal Role="QAPInstance"> 46 <PropertyRef Name=" name" />46 <PropertyRef Name="Name" /> 47 47 </Principal> 48 48 <Dependent Role="QAPSolution"> 49 <PropertyRef Name=" name" />49 <PropertyRef Name="Name" /> 50 50 </Dependent> 51 51 </ReferentialConstraint> 52 52 </Association> 53 </Schema> 54 </edmx:StorageModels> 53 </Schema></edmx:StorageModels> 55 54 <!-- CSDL content --> 56 55 <edmx:ConceptualModels> … … 59 58 <EntitySet Name="QAPInstances" EntityType="ProblemInstancesModel.QAPInstance" /> 60 59 <EntitySet Name="QAPSolutions" EntityType="ProblemInstancesModel.QAPSolution" /> 61 <AssociationSet Name="FK_QAPSolution_QAPInstance " Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance">60 <AssociationSet Name="FK_QAPSolution_QAPInstance1" Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance1"> 62 61 <End Role="QAPInstance" EntitySet="QAPInstances" /> 63 62 <End Role="QAPSolution" EntitySet="QAPSolutions" /> … … 66 65 <EntityType Name="QAPInstance"> 67 66 <Key> 68 <PropertyRef Name=" name" />67 <PropertyRef Name="Name" /> 69 68 </Key> 70 <Property Name="name" Type="String" Nullable="false" MaxLength="64" Unicode="true" FixedLength="false" />71 <Property Name="description" Type="String" MaxLength="Max" Unicode="true" FixedLength="false" />72 <Property Name="maximization" Type="Boolean" Nullable="false" />73 <Property Name="weights" Type="String" Nullable="false" MaxLength="Max" Unicode="false" FixedLength="false" />74 <Property Name="weights_sha1" Type="String" Nullable="false" MaxLength="40" Unicode="false" FixedLength="true" />75 <Property Name="distances" Type="String" Nullable="false" MaxLength="Max" Unicode="false" FixedLength="false" />76 <Property Name="distances_sha1" Type="String" Nullable="false" MaxLength="40" Unicode="false" FixedLength="true" />77 < Property Name="problemsize" Type="Int32" Nullable="false" />78 < NavigationProperty Name="QAPSolutions" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance" FromRole="QAPInstance" ToRole="QAPSolution" />69 <Property Type="String" Name="Name" Nullable="false" MaxLength="64" FixedLength="false" Unicode="true" /> 70 <Property Type="String" Name="Description" MaxLength="Max" FixedLength="false" Unicode="true" /> 71 <Property Type="Boolean" Name="Maximization" Nullable="false" /> 72 <Property Type="String" Name="Weights" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" /> 73 <Property Type="String" Name="WeightsHash" Nullable="false" MaxLength="40" FixedLength="true" Unicode="false" /> 74 <Property Type="String" Name="Distances" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" /> 75 <Property Type="String" Name="DistancesHash" Nullable="false" MaxLength="40" FixedLength="true" Unicode="false" /> 76 <NavigationProperty Name="Solutions" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance1" FromRole="QAPInstance" ToRole="QAPSolution" /> 77 <Property Type="Int32" Name="ProblemSize" Nullable="false" /> 79 78 </EntityType> 80 79 <EntityType Name="QAPSolution"> 81 80 <Key> 82 <PropertyRef Name=" id" />81 <PropertyRef Name="Id" /> 83 82 </Key> 84 <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />85 <Property Name="name" Type="String" Nullable="false" MaxLength="64" Unicode="true" FixedLength="false" />86 <Property Name="assignment" Type="String" Nullable="false" MaxLength="Max" Unicode="false" FixedLength="false" />87 <Property Name="assignment_sha1" Type="String" Nullable="false" MaxLength="40" Unicode="false" FixedLength="true" />88 <Property Name="quality" Type="Double" Nullable="false" />89 <NavigationProperty Name=" QAPInstance" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance" FromRole="QAPSolution" ToRole="QAPInstance" />83 <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> 84 <Property Type="String" Name="Name" Nullable="false" MaxLength="64" FixedLength="false" Unicode="true" /> 85 <Property Type="String" Name="Assignment" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" /> 86 <Property Type="String" Name="AssignmentHash" Nullable="false" MaxLength="40" FixedLength="true" Unicode="false" /> 87 <Property Type="Double" Name="Quality" Nullable="false" /> 88 <NavigationProperty Name="Instance" Relationship="ProblemInstancesModel.FK_QAPSolution_QAPInstance1" FromRole="QAPSolution" ToRole="QAPInstance" /> 90 89 </EntityType> 91 <Association Name="FK_QAPSolution_QAPInstance"> 92 <End Role="QAPInstance" Type="ProblemInstancesModel.QAPInstance" Multiplicity="1"> 93 <OnDelete Action="Cascade" /> 94 </End> 95 <End Role="QAPSolution" Type="ProblemInstancesModel.QAPSolution" Multiplicity="*" /> 90 <Association Name="FK_QAPSolution_QAPInstance1"> 91 <End Type="ProblemInstancesModel.QAPInstance" Role="QAPInstance" Multiplicity="1" /> 92 <End Type="ProblemInstancesModel.QAPSolution" Role="QAPSolution" Multiplicity="*" /> 96 93 <ReferentialConstraint> 97 94 <Principal Role="QAPInstance"> 98 <PropertyRef Name=" name" />95 <PropertyRef Name="Name" /> 99 96 </Principal> 100 97 <Dependent Role="QAPSolution"> 101 <PropertyRef Name=" name" />98 <PropertyRef Name="Name" /> 102 99 </Dependent> 103 100 </ReferentialConstraint> … … 110 107 <EntityContainerMapping StorageEntityContainer="ProblemInstancesModelStoreContainer" CdmEntityContainer="ProblemInstancesEntities"> 111 108 <EntitySetMapping Name="QAPInstances"><EntityTypeMapping TypeName="ProblemInstancesModel.QAPInstance"><MappingFragment StoreEntitySet="QAPInstance"> 112 <ScalarProperty Name=" name" ColumnName="name" />113 <ScalarProperty Name="description" ColumnName="description" />114 <ScalarProperty Name="maximization" ColumnName="maximization" />115 <ScalarProperty Name="weights" ColumnName="weights" />116 <ScalarProperty Name="weights_sha1" ColumnName="weights_sha1" />117 <ScalarProperty Name="distances" ColumnName="distances" />118 <ScalarProperty Name="distances_sha1" ColumnName="distances_sha1" />119 <ScalarProperty Name="problemsize" ColumnName="problemsize" />120 </MappingFragment></EntityTypeMapping></EntitySetMapping>109 <ScalarProperty Name="ProblemSize" ColumnName="ProblemSize" /> 110 <ScalarProperty Name="DistancesHash" ColumnName="DistancesHash" /> 111 <ScalarProperty Name="Distances" ColumnName="Distances" /> 112 <ScalarProperty Name="WeightsHash" ColumnName="WeightsHash" /> 113 <ScalarProperty Name="Weights" ColumnName="Weights" /> 114 <ScalarProperty Name="Maximization" ColumnName="Maximization" /> 115 <ScalarProperty Name="Description" ColumnName="Description" /> 116 <ScalarProperty Name="Name" ColumnName="Name" /> 117 </MappingFragment></EntityTypeMapping></EntitySetMapping> 121 118 <EntitySetMapping Name="QAPSolutions"><EntityTypeMapping TypeName="ProblemInstancesModel.QAPSolution"><MappingFragment StoreEntitySet="QAPSolution"> 122 <ScalarProperty Name=" id" ColumnName="id" />123 <ScalarProperty Name="name" ColumnName="name" />124 <ScalarProperty Name="assignment" ColumnName="assignment" />125 <ScalarProperty Name="assignment_sha1" ColumnName="assignment_sha1" />126 <ScalarProperty Name="quality" ColumnName="quality" />127 </MappingFragment></EntityTypeMapping></EntitySetMapping>119 <ScalarProperty Name="Quality" ColumnName="Quality" /> 120 <ScalarProperty Name="AssignmentHash" ColumnName="AssignmentHash" /> 121 <ScalarProperty Name="Assignment" ColumnName="Assignment" /> 122 <ScalarProperty Name="Name" ColumnName="Name" /> 123 <ScalarProperty Name="Id" ColumnName="Id" /> 124 </MappingFragment></EntityTypeMapping></EntitySetMapping> 128 125 </EntityContainerMapping> 129 126 </Mapping> … … 148 145 <Diagram Name="ProblemInstancesModel"> 149 146 <EntityTypeShape EntityType="ProblemInstancesModel.QAPInstance" Width="1.5" PointX="0.75" PointY="1" Height="2.7494921874999996" IsExpanded="true" /> 150 <EntityTypeShape EntityType="ProblemInstancesModel.QAPSolution" Width="1.5" PointX="3" PointY="1.25" Height="2.17258789062 49996" IsExpanded="true" />151 <AssociationConnector Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance " ManuallyRouted="false">147 <EntityTypeShape EntityType="ProblemInstancesModel.QAPSolution" Width="1.5" PointX="3" PointY="1.25" Height="2.172587890625" IsExpanded="true" /> 148 <AssociationConnector Association="ProblemInstancesModel.FK_QAPSolution_QAPInstance1" > 152 149 <ConnectorPoint PointX="2.25" PointY="2.3362939453125" /> 153 150 <ConnectorPoint PointX="3" PointY="2.3362939453125" /> -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/QAP/QAP.svc.cs
r6659 r6733 26 26 public string[] GetProblemInstances() { 27 27 using (ProblemInstancesEntities context = new ProblemInstancesEntities()) { 28 return context.QAPInstances.Select(x => x. name).ToArray();28 return context.QAPInstances.Select(x => x.Name).ToArray(); 29 29 } 30 30 } … … 32 32 public QAPInstanceDto GetProblemInstanceData(string instance) { 33 33 using (ProblemInstancesEntities context = new ProblemInstancesEntities()) { 34 return new QAPInstanceDto(context.QAPInstances.Where(x => x. name == instance).Single());34 return new QAPInstanceDto(context.QAPInstances.Where(x => x.Name == instance).Single()); 35 35 } 36 36 } … … 38 38 public QAPSolutionDto[] GetBestSolutionsData(string instance) { 39 39 using (ProblemInstancesEntities context = new ProblemInstancesEntities()) { 40 QAPInstance qap = context.QAPInstances.Where(x => x. name == instance).SingleOrDefault();40 QAPInstance qap = context.QAPInstances.Where(x => x.Name == instance).SingleOrDefault(); 41 41 if (qap == null) return new QAPSolutionDto[0]; 42 context.LoadProperty<QAPInstance>(qap, x => x.Solutions); 42 43 double best = double.NaN; 43 if (qap.maximization) best = qap.QAPSolutions.Max(x => x.quality); 44 else best = qap.QAPSolutions.Min(x => x.quality); 44 if (!qap.Solutions.Any()) return new QAPSolutionDto[0]; 45 45 46 return qap.QAPSolutions.Where(x => x.quality == best).Select(x => new QAPSolutionDto(x)).ToArray(); 46 if (qap.Maximization) best = qap.Solutions.Max(x => x.Quality); 47 else best = qap.Solutions.Min(x => x.Quality); 48 49 return qap.Solutions.Where(x => x.Quality == best).Select(x => new QAPSolutionDto(x)).ToArray(); 47 50 } 48 51 } -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/QAP/QAPInstanceDto.cs
r6659 r6733 1 2 #region License Information 1 #region License Information 3 2 /* HeuristicLab 4 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) … … 22 21 23 22 using System; 23 using System.Linq; 24 24 using System.Runtime.Serialization; 25 25 … … 37 37 [DataMember] 38 38 public double[][] Distances { get; set; } 39 [DataMember] 40 public double BestKnownQuality { get; set; } 41 [DataMember] 42 public bool HasBestKnownQuality { get; set; } 39 43 40 44 public QAPInstanceDto() { … … 43 47 44 48 public QAPInstanceDto(QAPInstance qAPInstance) { 45 Name = qAPInstance. name;46 Description = qAPInstance. description;47 Maximization = qAPInstance. maximization;49 Name = qAPInstance.Name; 50 Description = qAPInstance.Description; 51 Maximization = qAPInstance.Maximization; 48 52 try { 49 Weights = PrimitiveSerializer.DeserializeDoubleMatrix(qAPInstance.weights);50 Distances = PrimitiveSerializer.DeserializeDoubleMatrix(qAPInstance.distances);53 Weights = SimpleSerializer.DeserializeDoubleMatrix(qAPInstance.Weights); 54 Distances = SimpleSerializer.DeserializeDoubleMatrix(qAPInstance.Distances); 51 55 } catch (ArgumentException e) { 52 throw new PrimitiveSerializationException("Failed to deserialize the weights or distance matrix.", e); 56 throw new SimpleSerializationException("Failed to deserialize the weights or distance matrix.", e); 57 } 58 BestKnownQuality = double.NaN; 59 HasBestKnownQuality = false; 60 if (qAPInstance.Solutions.Any()) { 61 double bestQuality; 62 if (Maximization) bestQuality = qAPInstance.Solutions.Max(x => x.Quality); 63 else bestQuality = qAPInstance.Solutions.Min(x => x.Quality); 64 HasBestKnownQuality = true; 53 65 } 54 66 } -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/QAP/QAPSolutionDto.cs
r6659 r6733 1 2 #region License Information 1 #region License Information 3 2 /* HeuristicLab 4 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) … … 21 20 #endregion 22 21 22 using System; 23 23 using System.Runtime.Serialization; 24 24 … … 27 27 public class QAPSolutionDto { 28 28 [DataMember] 29 public bool AssignmentUndefined { get; set; } 30 [DataMember] 29 31 public int[] Assignment { get; set; } 30 32 [DataMember] … … 32 34 33 35 public QAPSolutionDto() { 34 36 Quality = double.NaN; 35 37 } 36 38 37 39 public QAPSolutionDto(QAPSolution x) { 38 Assignment = PrimitiveSerializer.DeserializeIntArray(x.assignment); 39 Quality = x.quality; 40 AssignmentUndefined = String.IsNullOrEmpty(x.Assignment); 41 if (!AssignmentUndefined) 42 Assignment = SimpleSerializer.DeserializeIntArray(x.Assignment); 43 Quality = x.Quality; 40 44 } 41 45 } -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/Web.Debug.config
r6659 r6733 4 4 5 5 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 6 6 <connectionStrings xdt:Transform="Insert"> 7 <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=HeuristicLab.ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> 8 </connectionStrings> 7 9 </configuration> -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/Web.Release.config
r6659 r6733 9 9 </system.web> 10 10 11 <connectionStrings xdt:Transform="Insert"> 12 <add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=LOCALHOST;Initial Catalog=HeuristicLab.ProblemInstances;Integrated Security=True"" providerName="System.Data.EntityClient" /> 13 </connectionStrings> 11 14 </configuration> -
branches/GeneralizedQAP/HeuristicLab.Services.ProblemInstances/Web.config
r6659 r6733 9 9 <serviceBehaviors> 10 10 <behavior> 11 <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 11 12 <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 12 13 <serviceMetadata httpGetEnabled="true" /> 13 14 <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 14 <serviceDebug includeExceptionDetailInFaults=" false" />15 <serviceDebug includeExceptionDetailInFaults="true" /> 15 16 </behavior> 16 17 </serviceBehaviors> … … 22 23 </system.webServer> 23 24 24 < connectionStrings><add name="ProblemInstancesEntities" connectionString="metadata=res://*/ProblemInstancesModel.csdl|res://*/ProblemInstancesModel.ssdl|res://*/ProblemInstancesModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MRPINK\SQLEXPRESS;Initial Catalog=ProblemInstances;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /></connectionStrings></configuration>25 </configuration>
Note: See TracChangeset
for help on using the changeset viewer.