Index: framspy/FramsticksLib.py
===================================================================
--- framspy/FramsticksLib.py	(revision 1295)
+++ framspy/FramsticksLib.py	(revision 1306)
@@ -1,3 +1,4 @@
 from typing import List  # to be able to specify a type hint of list(something)
+from enum import Enum, auto, unique
 import json
 import sys, os
@@ -5,4 +6,16 @@
 import numpy as np
 import frams
+
+
+@unique
+class DissimMethod(Enum):  # values assigned to fields are irrelevant, hence auto()
+	GENE_LEVENSHTEIN = auto()  # genetic Levenshtein distance
+	PHENE_STRUCT_GREEDY = auto()  # phenetic, graph structure, fast but approximate
+	PHENE_STRUCT_OPTIM = auto()  # phenetic, graph structure, slower for complex creatures but optimal
+	PHENE_DESCRIPTORS = auto()  # phenetic, shape descriptors
+	PHENE_DENSITY_COUNT = auto()  # phenetic, density distribution, count of samples
+	PHENE_DENSITY_FREQ = auto()  # phenetic, density distribution, frequency of count of samples
+	FITNESS = auto()  # fitness value
+
 
 
@@ -67,5 +80,5 @@
 		for simfile in self.EVALUATION_SETTINGS_FILE:
 			ec = frams.MessageCatcher.new()  # catch potential errors, warnings, messages - just to detect if there are ERRORs
-			ec.store = 2;  # store all, because they are caught by MessageCatcher and will not appear in output (which we want)
+			ec.store = 2  # store all, because they are caught by MessageCatcher and will not appear in output (which we want)
 			frams.Simulator.ximport(simfile, 4 + 8 + 16)
 			ec.close()
@@ -75,5 +88,5 @@
 
 
-	def getSimplest(self, genetic_format) -> str:
+	def getSimplest(self, genetic_format: str) -> str:
 		return frams.GenMan.getSimplest(genetic_format).genotype._string()
 
@@ -134,5 +147,5 @@
 		if not self.PRINT_FRAMSTICKS_OUTPUT:
 			ec = frams.MessageCatcher.new()  # mute potential errors, warnings, messages
-			ec.store = 2;  # store all, because they are caught by MessageCatcher and will not appear in output
+			ec.store = 2  # store all, because they are caught by MessageCatcher and will not appear in output
 
 		frams.GenePools[0].clear()
@@ -192,7 +205,7 @@
 
 
-	def dissimilarity(self, genotype_list: List[str], method: int) -> np.ndarray:
-		"""
-			:param method: -1 = genetic Levenshtein distance; 0, 1, 2 = phenetic dissimilarity (SimilMeasureGreedy, SimilMeasureHungarian, SimilMeasureDistribution); -2, -3 = phenetic density distribution (count, frequency).
+	def dissimilarity(self, genotype_list: List[str], method: DissimMethod) -> np.ndarray:
+		"""
+			:param method, see DissimMethod.
 			:return: A square array with dissimilarities of each pair of genotypes.
 		"""
@@ -206,6 +219,6 @@
 		square_matrix = np.zeros((n, n))
 
-		if method in (0, 1, 2):  # Framsticks phenetic dissimilarity methods
-			frams.SimilMeasure.simil_type = method
+		if method in (DissimMethod.PHENE_STRUCT_GREEDY, DissimMethod.PHENE_STRUCT_OPTIM, DissimMethod.PHENE_DESCRIPTORS):  # Framsticks phenetic dissimilarity methods
+			frams.SimilMeasure.simil_type = 0 if method == DissimMethod.PHENE_STRUCT_GREEDY else 1 if method == DissimMethod.PHENE_STRUCT_OPTIM else 2
 			genos = []  # prepare an array of Geno objects so that we don't need to convert raw strings to Geno objects all the time in loops
 			for g in genotype_list:
@@ -215,17 +228,17 @@
 				for j in range(n):  # maybe calculate only one triangle if you really need a 2x speedup
 					square_matrix[i][j] = frams_evaluateDistance(genos[i], genos[j])._double()
-		elif method == -1:
+		elif method == DissimMethod.GENE_LEVENSHTEIN:
 			import Levenshtein
 			for i in range(n):
 				for j in range(n):  # maybe calculate only one triangle if you really need a 2x speedup
 					square_matrix[i][j] = Levenshtein.distance(genotype_list[i], genotype_list[j])
-		elif method in (-2, -3):
+		elif method in (DissimMethod.PHENE_DENSITY_COUNT, DissimMethod.PHENE_DENSITY_FREQ):
 			if self.dissim_measure_density_distribution is None:
 				from dissimilarity.density_distribution import DensityDistribution
 				self.dissim_measure_density_distribution = DensityDistribution(frams)
-			self.dissim_measure_density_distribution.frequency = (method == -3)
+			self.dissim_measure_density_distribution.frequency = (method == DissimMethod.PHENE_DENSITY_FREQ)
 			square_matrix = self.dissim_measure_density_distribution.getDissimilarityMatrix(genotype_list)
 		else:
-			raise ValueError("Don't know what to do with dissimilarity method = %d" % method)
+			raise ValueError("Don't know what to do with dissimilarity method = %s" % method)
 
 		for i in range(n):
@@ -381,5 +394,5 @@
 	offspring = framsLib.crossOver(parent1, parent2)
 	print("\tCrossover (Offspring):", offspring)
-	print('\tDissimilarity of Parent1 and Offspring:', framsLib.dissimilarity([parent1, offspring], 1)[0, 1])
+	print('\tDissimilarity of Parent1 and Offspring:', framsLib.dissimilarity([parent1, offspring], DissimMethod.PHENE_STRUCT_OPTIM)[0, 1])
 	print('\tPerformance of Offspring:', framsLib.evaluate([offspring]))
 	print('\tValidity (genetic) of Parent1, Parent 2, and Offspring:', framsLib.isValid([parent1, parent2, offspring]))
