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 HeuristicLab.GP.Interfaces;
|
---|
23 |
|
---|
24 | namespace HeuristicLab.GP.SantaFe {
|
---|
25 | public class FunctionLibraryInjector : FunctionLibraryInjectorBase {
|
---|
26 |
|
---|
27 | public override string Description {
|
---|
28 | get { return @"Injects a function library for the ant problem."; }
|
---|
29 | }
|
---|
30 |
|
---|
31 | public FunctionLibraryInjector()
|
---|
32 | : base() {
|
---|
33 | }
|
---|
34 |
|
---|
35 | protected override FunctionLibrary CreateFunctionLibrary() {
|
---|
36 | FunctionLibrary funLib = new FunctionLibrary();
|
---|
37 | IfFoodAhead ifFoodAhead = new IfFoodAhead();
|
---|
38 | Prog2 prog2 = new Prog2();
|
---|
39 | Prog3 prog3 = new Prog3();
|
---|
40 | Move move = new Move();
|
---|
41 | Left left = new Left();
|
---|
42 | Right right = new Right();
|
---|
43 |
|
---|
44 | IFunction[] allFunctions = new IFunction[] {
|
---|
45 | ifFoodAhead,
|
---|
46 | prog2,
|
---|
47 | prog3,
|
---|
48 | move,
|
---|
49 | left,
|
---|
50 | right
|
---|
51 | };
|
---|
52 |
|
---|
53 | SetAllowedSubOperators(ifFoodAhead, allFunctions);
|
---|
54 | SetAllowedSubOperators(prog2, allFunctions);
|
---|
55 | SetAllowedSubOperators(prog3, allFunctions);
|
---|
56 |
|
---|
57 | funLib.AddFunction(ifFoodAhead);
|
---|
58 | funLib.AddFunction(prog2);
|
---|
59 | funLib.AddFunction(prog3);
|
---|
60 | funLib.AddFunction(move);
|
---|
61 | funLib.AddFunction(left);
|
---|
62 | funLib.AddFunction(right);
|
---|
63 | return funLib;
|
---|
64 | }
|
---|
65 | }
|
---|
66 | }
|
---|