Example #1
0
 def createCLI(self, level=0):
     self.pid_version += 1
     if level > 20:
         raise ConnectionError("FramsCLI recursion over 20")
     try:
         if self.framsCLI is not None and level < 10:
             self.framsCLI.closeFramsticksCLI()
         framsCLId = FramsticksCLI(self.config['frams_path'], None if 'framsexe' not in self.config else self.config['framsexe'],
                                   pid=self.config['model_name'] + "_" + str(level) + (
                                       '' if 'pid_extension' not in self.config else self.config['pid_extension']) +
                                    "_" + self.pid_extra_extension + "_" + str(self.pid_version),
                                   importSim=self.config['importSim'], markers=self.config['markers'], config=self.config)
         print("OK_CORRECTLY CREATED__", level)
     except Exception as e:
         self.createCLI(level=level + 1)
         return
     self.framsCLI = framsCLId
     self.framsCLI.invalidCnt = self.invalidCnt
     self.framsCLI.validCnt = self.validCnt
     self.framsCLI.em = self
     if self.config['locality_type'] == 'dissim' or self.config['locality_type'] == 'fitness':
         self.dissimilarity = self.framsCLI.dissimilarity
     elif self.config['locality_type'] == 'levens':
         self.dissimilarity = dissimilarity_lev
     else:
         self.dissimilarity = dissimilarity_rand
def checkValidity(genos, howMany, config):
    framsCLI = FramsticksCLI('C:/Users/Piotr/Desktop/Framsticks50rc17', None)

    total_acc, xs, accs, ys = get_Accs(genos, howMany, framsCLI, config)

    framsCLI.closeFramsticksCLI()

    return total_acc, xs, accs, ys
Example #3
0
 def createCLI(self, level=0):
     if level > 20:
         raise ConnectionError("FramsCLI recursion over 20")
     try:
         if self.framsCLI is not None and level < 10:
             self.framsCLI.closeFramsticksCLI()
         framsCLId = FramsticksCLI(self.config['frams_path'], None if 'framsexe' not in self.config else self.config['framsexe'],
                                   pid=self.config['model_name'] + "_"+ str(level) + (
                                       '' if 'pid_extension' not in self.config else self.config['pid_extension']),
                                   importSim=self.config['importSim'], markers=self.config['markers'], config=self.config)
         print("OK_CORRECTLY CREATED__", level)
     except Exception as e:
         self.createCLI(level=level + 1)
         return
     self.framsCLI = framsCLId
     self.framsCLI.invalidCnt = self.invalidCnt
     self.framsCLI.validCnt = self.validCnt
     self.framsCLI.em = self
Example #4
0
def createCLI(config, oldCLI=None, level=0):
    if level > 20:
        raise ConnectionError("FramsCLI recursion over 20")
    try:
        if oldCLI is not None:
            importSim = oldCLI.importSim
            markers = oldCLI.markers
        else:
            importSim = config['importSim']
            markers = config['markers']
        if oldCLI is not None and level < 10:
            oldCLI.closeFramsticksCLI()
        framsCLId = FramsticksCLI(
            config['frams_path'],
            None if 'framsexe' not in config else config['framsexe'],
            pid=config['model_name'] + str(level) +
            ('' if 'pid_extension' not in config else config['pid_extension']),
            importSim=importSim,
            markers=markers,
            config=config)
        print("OK_CORRECTLY CREATED__", level)
    except:
        return createCLI(config, oldCLI, level=level + 1)
    return framsCLId