Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/12/18 14:23:45 (6 years ago)
Author:
ddorfmei
Message:

#2931:

  • upgraded Google OR-Tools to version 6.10
  • added TextValue and TextValueView to be able to display and edit a multiline string
  • added parameter to set solver specific parameters for supported solvers
  • added support for the Protocol Buffers representation of models (import/export)
  • added import of MPS models
  • added pause/stop functionality to CplexSolver and GlpkSolver
  • refactored wrapper (LinearSolver and related enums)
  • added new algorithm category Exact for LinearProgrammingAlgorithm
Location:
branches/2931_OR-Tools_LP_MIP/HeuristicLab.Data/3.3
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/2931_OR-Tools_LP_MIP/HeuristicLab.Data/3.3/HeuristicLab.Data-3.3.csproj

    r16070 r16373  
    124124    <Compile Include="ComparisonType.cs" />
    125125    <Compile Include="EnumValue.cs" />
     126    <Compile Include="Interfaces\ITextValue.cs" />
    126127    <Compile Include="Interfaces\IValueTypeArray.cs" />
    127128    <Compile Include="Path Types\DirectoryValue.cs" />
     
    151152    <Compile Include="StringConvertibleArray.cs" />
    152153    <Compile Include="StringMatrix.cs" />
     154    <Compile Include="TextValue.cs" />
    153155    <Compile Include="StringValue.cs" />
    154156    <Compile Include="TimeSpanValue.cs" />
  • branches/2931_OR-Tools_LP_MIP/HeuristicLab.Data/3.3/Interfaces/ITextValue.cs

    r16337 r16373  
    2424
    2525namespace HeuristicLab.Data {
    26   public interface IStringConvertibleValue : IContent {
    27     bool ReadOnly { get; }
    28 
    29     bool Validate(string value, out string errorMessage);
    30     string GetValue();
    31     bool SetValue(string value);
    32 
    33     event EventHandler ValueChanged;
     26  public interface ITextValue : IStringConvertibleValue {
    3427  }
    3528}
  • branches/2931_OR-Tools_LP_MIP/HeuristicLab.Data/3.3/TextValue.cs

    r16337 r16373  
    2020#endregion
    2121
    22 using System;
    23 using System.Drawing;
    2422using HeuristicLab.Common;
    2523using HeuristicLab.Core;
     
    2725
    2826namespace HeuristicLab.Data {
    29   [Item("StringValue", "Represents a string.")]
     27  [Item("TextValue", "Represents a multiline string.")]
    3028  [StorableClass]
    31   public class StringValue : Item, IComparable, IStringConvertibleValue {
    32     public static new Image StaticItemImage {
    33       get { return HeuristicLab.Common.Resources.VSImageLibrary.Field; }
     29  public class TextValue : StringValue, ITextValue {
     30
     31    public TextValue() {
     32      this.value = string.Empty;
     33      this.readOnly = false;
    3434    }
    3535
    36     [Storable]
    37     protected string value;
    38     public virtual string Value {
    39       get { return value; }
    40       set {
    41         if (ReadOnly) throw new NotSupportedException("Value cannot be set. StringValue is read-only.");
    42         if (value != this.value) {
    43           if ((value != null) || (this.value != string.Empty)) {
    44             this.value = value != null ? value : string.Empty;
    45             OnValueChanged();
    46           }
    47         }
    48       }
    49     }
    50 
    51     [Storable]
    52     protected bool readOnly;
    53     public virtual bool ReadOnly {
    54       get { return readOnly; }
     36    public TextValue(string value) {
     37      this.value = value ?? string.Empty;
     38      this.readOnly = false;
    5539    }
    5640
    5741    [StorableConstructor]
    58     protected StringValue(bool deserializing) : base(deserializing) { }
    59     protected StringValue(StringValue original, Cloner cloner)
     42    protected TextValue(bool deserializing) : base(deserializing) { }
     43
     44    protected TextValue(TextValue original, Cloner cloner)
    6045      : base(original, cloner) {
    61       this.value = original.value != null ? original.value : string.Empty;
     46      this.value = original.value ?? string.Empty;
    6247      this.readOnly = original.readOnly;
    63     }
    64     public StringValue() {
    65       this.value = string.Empty;
    66       this.readOnly = false;
    67     }
    68     public StringValue(string value) {
    69       this.value = value != null ? value : string.Empty;
    70       this.readOnly = false;
    7148    }
    7249
    7350    public override IDeepCloneable Clone(Cloner cloner) {
    74       return new StringValue(this, cloner);
     51      return new TextValue(this, cloner);
    7552    }
    76 
    77     public virtual StringValue AsReadOnly() {
    78       StringValue readOnlyStringValue = (StringValue)this.Clone();
    79       readOnlyStringValue.readOnly = true;
    80       return readOnlyStringValue;
    81     }
    82 
    83     public override string ToString() {
    84       return value;
    85     }
    86 
    87     public virtual int CompareTo(object obj) {
    88       StringValue other = obj as StringValue;
    89       if (other != null)
    90         return Value.CompareTo(other.Value);
    91       else
    92         return Value.CompareTo(obj);
    93     }
    94 
    95     public event EventHandler ValueChanged;
    96     protected virtual void OnValueChanged() {
    97       if (ValueChanged != null)
    98         ValueChanged(this, EventArgs.Empty);
    99       OnToStringChanged();
    100     }
    101 
    102     protected virtual bool Validate(string value, out string errorMessage) {
    103       if (value == null) {
    104         errorMessage = "Invalid Value (string must not be null)";
    105         return false;
    106       } else {
    107         errorMessage = string.Empty;
    108         return true;
    109       }
    110     }
    111     protected virtual string GetValue() {
    112       return Value;
    113     }
    114     protected virtual bool SetValue(string value) {
    115       if (value != null) {
    116         Value = value;
    117         return true;
    118       } else {
    119         return false;
    120       }
    121     }
    122 
    123     #region IStringConvertibleValue Members
    124     bool IStringConvertibleValue.Validate(string value, out string errorMessage) {
    125       return Validate(value, out errorMessage);
    126     }
    127     string IStringConvertibleValue.GetValue() {
    128       return GetValue();
    129     }
    130     bool IStringConvertibleValue.SetValue(string value) {
    131       return SetValue(value);
    132     }
    133     #endregion
    13453  }
    13554}
Note: See TracChangeset for help on using the changeset viewer.