Index: framspy/evolalg/base/experiment_niching_abc.py
===================================================================
--- framspy/evolalg/base/experiment_niching_abc.py	(revision 1270)
+++ framspy/evolalg/base/experiment_niching_abc.py	(revision 1271)
@@ -1,5 +1,4 @@
 import time
 from abc import ABC, abstractmethod
-from tkinter import W
 
 import numpy as np
@@ -29,11 +28,14 @@
         self.fit = fit
         self.normalize = normalize
-        self.knn_niching = knn_niching
+        self.knn_niching = knn_niching # this parameter is used for local novelty and local niching
         self.knn_nslc = knn_nslc
         self.archive_size=archive_size
-        if popsize < self.knn_niching:
-            self.knn_niching = popsize - 2
-        if popsize < self.knn_nslc:
-            self.knn_nslc = popsize - 2
+
+        # np.argpartition requires these parameters to be at most popsize-2; popsize is decreased by 1 because we remove_diagonal()
+        if self.knn_niching > popsize - 2:
+            raise ValueError("knn_niching (%d) should be at most popsize-2 (%d)" % (self.knn_niching, popsize-2))
+        if self.knn_nslc > popsize - 2:
+            raise ValueError("knn_nslc (%d) should be at most popsize-2 (%d)" % (self.knn_nslc, popsize-2))
+
 
     def transform_indexes(self, i, index_array):
@@ -41,5 +43,5 @@
 
     def normalize_dissim(self, dissim_matrix):
-        dissim_matrix = remove_diagonal(np.array(dissim_matrix))
+        dissim_matrix = remove_diagonal(np.array(dissim_matrix)) # on the diagonal we usually have zeros (an individual is identical with itself, so the dissimilarity is 0). In some techniques we need to find "k" most similar individuals, so we remove the diagonal so that self-similarity of individuals does not interfere with finding "k" other most similar individuals. The matrix from square n*n turns into n*(n-1).
         if self.normalize == "none":
             return dissim_matrix
@@ -72,5 +74,5 @@
         else:
             raise Exception("Wrong fit type: ", self.fit,
-                            f" chose correct one or implement new behavior")
+                            f" choose the correct one or implement a new behavior.")
         population_structures.update_archive(dissim_matrix, population_archive)
 
@@ -90,8 +92,8 @@
                 temp_dissim, index_array, axis=-1))
             temp_fitness = population[i].rawfitness
-            population_of_most_different = list(
+            population_of_most_similar = list(
                 map(population.__getitem__, self.transform_indexes(i, index_array)))
             temp_ind_fit = sum(
-                [1 for ind in population_of_most_different if ind.rawfitness < temp_fitness])
+                [1 for ind in population_of_most_similar if ind.rawfitness < temp_fitness])
             population[i].fitness = DeapFitness(
                 tuple((dissim_value, temp_ind_fit)))
@@ -165,5 +167,5 @@
 
             if type(self.population_structures.population[0].fitness) == DeapFitness:
-                self.population_structures.population = self.make_new_population_nsga2(
+                self.population_structures.population = self.make_new_population_nsga2(  # used both for nsga2 and nslc
                     self.population_structures.population, pmut, pxov)
             else:
@@ -184,14 +186,16 @@
     def get_args_for_parser():
         parser = ExperimentABC.get_args_for_parser()
-        parser.add_argument("-dissim",type= int, default= "frams",
-                   help="Dissimilarity measure type. Availible -2:emd, -1:lev, 1:frams1 (default}, 2:frams2")
-        parser.add_argument("-fit",type= str, default= "raw",
-                        help="Fitness type, availible  types: niching, novelty, nsga2, nslc and raw (default}")
-        parser.add_argument("-archive",type= int, default= 50,
+        parser.add_argument("-dissim",type= int, default=1,
+                   help="Dissimilarity measure type. Available: -3:freq, -2:dens, -1:Leven, 1:frams-struct (default}, 2:frams-descr")
+        parser.add_argument("-fit",type= str, default="raw",
+                        help="Fitness type, availible types: niching, novelty, knn_niching (local), knn_novelty (local), nsga2, nslc and raw (default)")
+        parser.add_argument("-archive",type= int, default=50,
                             help="Maximum archive size")
         parser.add_argument("-normalize",type= str, default= "max",
-                            help="What normalization use for dissimilarity matrix, max (default}, sum and none")
-        parser.add_argument("-knn",type= int, default= 0,
-                        help="Nearest neighbors parameter for local novelty/niching, if knn==0 global is performed. Default: 0")
+                            help="What normalization to use for the dissimilarity matrix: max (default}, sum, or none")
+        parser.add_argument("-knn_niching",type= int, default=5,
+                        help="The number of nearest neighbors for local novelty/niching. If knn==0, global is performed. Default: 5")
+        parser.add_argument("-knn_nslc",type= int, default=5,
+                        help="The number of nearest neighbors for NSLC. If knn==0, global is performed. Default: 5")
         return parser 
         
