How to use the retentioneering.core.simulator.Agent function in retentioneering

To help you get started, we’ve selected a few retentioneering examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github retentioneering / retentioneering-tools / retentioneering / core / simulator.py View on Github external
else:  # if tables is a list
            files = tables
        agents = []
        for idx, file in enumerate(files):
            if type(num_pops) == int:
                agents_num = num_pops  # int(pd.read_csv(os.path.join(stats, file)).users_count.iloc[0])
            else:
                agents_num = num_pops[idx]
            if type(tables) == str:
                clus_dyn = pd.read_csv(os.path.join(dyn_mat, file), index_col=[0])
                for i in range(agents_num):
                    agents.append(Agent(clus_dyn, file.split('_')[1].split('.')[0], self.restriction_pos, config))
            else:
                step_matr = self.prepare_step_matrix(file)
                for i in range(agents_num):
                    agents.append(Agent(step_matr, idx, self.restriction_pos, config))
        return agents
github retentioneering / retentioneering-tools / retentioneering / core / simulator.py View on Github external
if type(tables) == str:  # through folders
            dyn_mat = os.path.join(path, tables)
            files = sorted(
                list(filter(lambda x: x[0] != '.', os.listdir(dyn_mat))))  # collect all files except MacOS system files
        else:  # if tables is a list
            files = tables
        agents = []
        for idx, file in enumerate(files):
            if type(num_pops) == int:
                agents_num = num_pops  # int(pd.read_csv(os.path.join(stats, file)).users_count.iloc[0])
            else:
                agents_num = num_pops[idx]
            if type(tables) == str:
                clus_dyn = pd.read_csv(os.path.join(dyn_mat, file), index_col=[0])
                for i in range(agents_num):
                    agents.append(Agent(clus_dyn, file.split('_')[1].split('.')[0], self.restriction_pos, config))
            else:
                step_matr = self.prepare_step_matrix(file)
                for i in range(agents_num):
                    agents.append(Agent(step_matr, idx, self.restriction_pos, config))
        return agents