1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Text;
|
---|
25 | using System.Xml;
|
---|
26 | using HeuristicLab.Core;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Constraints {
|
---|
29 | public class FalseConstraint : ConstraintBase {
|
---|
30 | public override string Description {
|
---|
31 | get { return "This constraint is always false."; }
|
---|
32 | }
|
---|
33 | /// <summary>
|
---|
34 | /// Default constructor.
|
---|
35 | /// </summary>
|
---|
36 | public FalseConstraint() { }
|
---|
37 | /// <summary>
|
---|
38 | /// Copy constructor to create clones (deep).
|
---|
39 | /// </summary>
|
---|
40 | /// <param name="original">The original instance to be cloned.</param>
|
---|
41 | public FalseConstraint(FalseConstraint original) : this(original, new Dictionary<Guid, object>()) { }
|
---|
42 | /// <summary>
|
---|
43 | /// Copy constructor to create clones (deep) reusing already cloned object references.
|
---|
44 | /// </summary>
|
---|
45 | /// <param name="original">The instance to be cloned.</param>
|
---|
46 | /// <param name="clonedObjects">Already cloned objects (for referential integrity).</param>
|
---|
47 | protected FalseConstraint(FalseConstraint original, IDictionary<Guid, object> clonedObjects)
|
---|
48 | : base(original, clonedObjects) { }
|
---|
49 |
|
---|
50 | public override IView CreateView() {
|
---|
51 | return new FalseConstraintView(this);
|
---|
52 | }
|
---|
53 |
|
---|
54 | /// <summary>
|
---|
55 | /// Clones an instance using the copy constructor
|
---|
56 | /// reusing already cloned object references.
|
---|
57 | /// </summary>
|
---|
58 | /// <param name="clonedObjects">Already cloned objects (for referential integrity).</param>
|
---|
59 | /// <returns>A cloned (deep) instance</returns>
|
---|
60 | public override object Clone(IDictionary<Guid, object> clonedObjects) {
|
---|
61 | return new FalseConstraint(this, clonedObjects);
|
---|
62 | }
|
---|
63 |
|
---|
64 | public override bool Check(IItem data) {
|
---|
65 | return false;
|
---|
66 | }
|
---|
67 | }
|
---|
68 | }
|
---|