]> ruin.nu Git - germs.git/blobdiff - src/genesorter.h
lower case is nicer
[germs.git] / src / genesorter.h
diff --git a/src/genesorter.h b/src/genesorter.h
new file mode 100644 (file)
index 0000000..fa47b05
--- /dev/null
@@ -0,0 +1,53 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by Michael Andreen                                 *
+ *   andreen@student.chalmers.se                                           *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA          *
+ ***************************************************************************/
+
+#ifndef __GENESORTER_H__
+#define __GENESORTER_H__
+
+#include "geneorder.h"
+#include "sortaction.h"
+
+#include <vector>
+
+
+/**
+ * Abstract baseclass for different gene sorters.
+ * \author Michael Andreen
+ */
+class GeneSorter{
+       public:
+               typedef std::vector<SortAction> ActionList;
+
+               /**
+                * Takes a GeneOrder, finds the actions to transform it into a sorted
+                * permutation and returns the list with required actions.
+                */
+               virtual ActionList sort(const GeneOrder& go1) = 0;
+
+               /**
+                * Find the safe actions for this GeneOrder.
+                */
+               virtual ActionList safeActions(const GeneOrder& go1) = 0;
+
+               virtual ~GeneSorter(){};
+};
+
+#endif
+