[2] | 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 HeuristicLab.Data;
|
---|
| 26 | using HeuristicLab.Core;
|
---|
| 27 | using System.Xml;
|
---|
| 28 | using HeuristicLab.DataAnalysis;
|
---|
| 29 |
|
---|
| 30 | namespace HeuristicLab.Functions {
|
---|
[155] | 31 | /// <summary>
|
---|
| 32 | /// Functions are like operators except that they do not allow sub-operators and the normal form of evaluation
|
---|
| 33 | /// is to evaluate all children first.
|
---|
| 34 | /// </summary>
|
---|
[2] | 35 | public abstract class FunctionBase : OperatorBase, IFunction {
|
---|
[429] | 36 | public const string INITIALIZATION = "Initialization";
|
---|
| 37 | public const string MANIPULATION = "Manipulation";
|
---|
[2] | 38 |
|
---|
[425] | 39 |
|
---|
[229] | 40 | public virtual double Apply(Dataset dataset, int sampleIndex, double[] args) {
|
---|
| 41 | throw new NotImplementedException();
|
---|
| 42 | }
|
---|
| 43 |
|
---|
[165] | 44 | public virtual void Accept(IFunctionVisitor visitor) {
|
---|
| 45 | visitor.Visit(this);
|
---|
| 46 | }
|
---|
| 47 |
|
---|
[189] | 48 | public virtual IFunctionTree GetTreeNode() {
|
---|
[229] | 49 | return new BakedFunctionTree(this);
|
---|
[189] | 50 | }
|
---|
| 51 |
|
---|
[155] | 52 | // operator-tree style evaluation is not supported for functions.
|
---|
[2] | 53 | public override IOperation Apply(IScope scope) {
|
---|
[155] | 54 | throw new NotSupportedException();
|
---|
[2] | 55 | }
|
---|
| 56 |
|
---|
[155] | 57 | private static readonly List<IOperator> emptySubOperatorList = new List<IOperator>();
|
---|
| 58 | public override IList<IOperator> SubOperators {
|
---|
| 59 | get { return emptySubOperatorList; }
|
---|
| 60 | }
|
---|
| 61 |
|
---|
[2] | 62 | public override void AddSubOperator(IOperator subOperator) {
|
---|
[155] | 63 | throw new NotSupportedException();
|
---|
[2] | 64 | }
|
---|
| 65 |
|
---|
| 66 | public override bool TryAddSubOperator(IOperator subOperator) {
|
---|
[155] | 67 | throw new NotSupportedException();
|
---|
[2] | 68 | }
|
---|
| 69 |
|
---|
| 70 | public override bool TryAddSubOperator(IOperator subOperator, int index) {
|
---|
[155] | 71 | throw new NotSupportedException();
|
---|
[2] | 72 | }
|
---|
| 73 |
|
---|
| 74 | public override bool TryAddSubOperator(IOperator subOperator, int index, out ICollection<IConstraint> violatedConstraints) {
|
---|
[155] | 75 | throw new NotSupportedException();
|
---|
[2] | 76 | }
|
---|
| 77 |
|
---|
| 78 | public override bool TryAddSubOperator(IOperator subOperator, out ICollection<IConstraint> violatedConstraints) {
|
---|
[155] | 79 | throw new NotSupportedException();
|
---|
[2] | 80 | }
|
---|
| 81 |
|
---|
| 82 | public override void AddSubOperator(IOperator subOperator, int index) {
|
---|
[155] | 83 | throw new NotSupportedException();
|
---|
[2] | 84 | }
|
---|
| 85 |
|
---|
| 86 | public override void RemoveSubOperator(int index) {
|
---|
[155] | 87 | throw new NotSupportedException();
|
---|
[2] | 88 | }
|
---|
| 89 |
|
---|
| 90 | public override bool TryRemoveSubOperator(int index) {
|
---|
[155] | 91 | throw new NotSupportedException();
|
---|
[2] | 92 | }
|
---|
| 93 |
|
---|
| 94 | public override bool TryRemoveSubOperator(int index, out ICollection<IConstraint> violatedConstraints) {
|
---|
[155] | 95 | throw new NotSupportedException();
|
---|
[2] | 96 | }
|
---|
| 97 | }
|
---|
| 98 | }
|
---|