ian@0: // Copyright 2011, Ian Hobson. ian@0: // ian@0: // This file is part of gpsynth. ian@0: // ian@0: // gpsynth is free software: you can redistribute it and/or modify ian@0: // it under the terms of the GNU General Public License as published by ian@0: // the Free Software Foundation, either version 3 of the License, or ian@0: // (at your option) any later version. ian@0: // ian@0: // gpsynth is distributed in the hope that it will be useful, ian@0: // but WITHOUT ANY WARRANTY; without even the implied warranty of ian@0: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ian@0: // GNU General Public License for more details. ian@0: // ian@0: // You should have received a copy of the GNU General Public License ian@0: // along with gpsynth in the file COPYING. ian@0: // If not, see http://www.gnu.org/licenses/. ian@0: ian@0: // The Grammar interface. ian@0: ian@0: // TODO split out mutation behaviour in to new class ian@0: ian@0: #pragma once ian@0: ian@0: #include "synth_graph.hpp" ian@0: ian@0: struct GrammarInterface { ian@0: ian@0: virtual void RandomGraph(sg::Graph& graph) const = 0; ian@0: ian@0: //virtual sg::Graph MutateGraph(const sg::Graph& graph) const = 0; ian@0: ian@0: virtual void PickCrossoverNodes(const sg::Graph& parent_1, ian@0: const sg::Graph& parent_2, ian@0: sg::Vertex* node_1, ian@0: sg::Vertex* node_2) const = 0; ian@0: ian@0: virtual bool MutationAddSubTree(sg::Graph& graph) const = 0; ian@0: virtual bool MutationReplaceSubTree(sg::Graph& graph) const = 0; ian@0: virtual bool MutationModifyInputs(sg::Graph& graph) const = 0; ian@0: virtual bool MutationModifyConnections(sg::Graph& graph) const = 0; ian@0: virtual bool MutationReplaceCommand(sg::Graph& graph) const = 0; ian@0: virtual bool MutationInsertCommand(sg::Graph& graph) const = 0; ian@0: };