Changeset 1079


Ignore:
Timestamp:
02/17/21 14:32:44 (4 years ago)
Author:
Maciej Komosinski
Message:

Cosmetic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/FramsticksCLI.py

    r1076 r1079  
    1111
    1212class FramsticksCLI:
    13         """Runs Framsticks CLI (command-line) executable and communicates with it using standard input and output.
     13        """Note: instead of this class, you should use the simpler, faster, and more reliable FramsticksLib.py.
     14       
     15        This class runs Framsticks CLI (command-line) executable and communicates with it using standard input and output.
    1416        You can perform basic operations like mutation, crossover, and evaluation of genotypes.
    1517        This way you can perform evolution controlled by python as well as access and manipulate genotypes.
     
    2123
    2224        PRINT_FRAMSTICKS_OUTPUT: bool = False  # set to True for debugging
    23         DETERMINISTIC: bool = False  # set to True to have the same results on each run
     25        DETERMINISTIC: bool = False  # set to True to have the same results in each run
    2426
    2527        GENO_SAVE_FILE_FORMAT = Enum('GENO_SAVE_FILE_FORMAT', 'NATIVEFRAMS RAWGENO')  # how to save genotypes
     
    236238                """
    237239                Returns:
    238                         The genotype of the offspring. Empty string if the crossing over failed.
     240                        The genotype of the offspring. self.GENOTYPE_INVALID if the crossing over failed.
    239241                """
    240242                files = self.__runCommand(self.CROSSOVER_CMD, [genotype_parent1, genotype_parent2], self.CROSSOVER_FILE, self.GENO_SAVE_FILE_FORMAT["RAWGENO"])
     
    302304        # - "vectorize" crossover so that many genotypes is handled in one call. Even better, use .so/.dll direct communication to CLI
    303305        # - use threads for non-blocking reading from frams' stdout and thus not relying on specific strings printed by frams
    304         # - a pool of binaries run at the same time, balance load - in particular evaluation
     306        # - a pool of binaries running simultaneously, balance load - in particular evaluation
    305307        # - if we read genotypes in "org:" format anywhere: import https://pypi.org/project/framsreader and use it if successful,
    306308        #    if not then print a message "framsreader not available, using simple internal method to save a genotype" and proceed as it is now.
     
    317319        parent2 = parent1
    318320        MUTATE_COUNT = 10
    319         for x in range(MUTATE_COUNT):  # example of a chain of 20 mutations
     321        for x in range(MUTATE_COUNT):  # example of a chain of 10 mutations
    320322                parent2 = framsCLI.mutate([parent2])[0]
    321323        print("\tParent1 (mutated simplest):", parent1)
Note: See TracChangeset for help on using the changeset viewer.