コード例 #1
0
ファイル: steels_experiment.py プロジェクト: SylwiaT/cog-abm
def steels_basic_experiment_GG(inc_category_treshold=0.95,
                               classifier=None,
                               interaction_type="GG",
                               beta=1.,
                               context_size=4,
                               stimuli=None,
                               agents=None,
                               dump_freq=50,
                               alpha=0.1,
                               sigma=1.,
                               num_iter=1000,
                               topology=None):

    classifier, classif_arg = SteelsClassifier, []
    #agents = [Agent(SteelsAgentStateWithLexicon(classifier()), SimpleSensor())\

    # FIX THIS !!
    classif_arg = def_value(classif_arg, [])
    for agent in agents:
        agent.set_state(SteelsAgentStateWithLexicon(classifier(*classif_arg)))
        agent.set_sensor(SimpleSensor())
        agent.set_fitness_measure("DG", metrics.get_DS_fitness())
        agent.set_fitness_measure("GG", metrics.get_CS_fitness())

    AdaptiveNetwork.def_alpha = float(alpha)
    AdaptiveNetwork.def_beta = float(beta)
    ReactiveUnit.def_sigma = float(sigma)
    DiscriminationGame.def_inc_category_treshold = float(inc_category_treshold)

    return steels_uniwersal_basic_experiment(num_iter,
                                             agents,
                                             GuessingGame(None, context_size),
                                             topology=topology,
                                             dump_freq=dump_freq,
                                             stimuli=stimuli)
コード例 #2
0
ファイル: steels_experiment.py プロジェクト: SylwiaT/cog-abm
def steels_basic_experiment_GG(inc_category_treshold=0.95, classifier=None,
        interaction_type="GG", beta=1., context_size=4, stimuli=None,
        agents=None, dump_freq=50, alpha=0.1, sigma=1., num_iter=1000,
        topology=None):

    classifier, classif_arg = SteelsClassifier, []
    #agents = [Agent(SteelsAgentStateWithLexicon(classifier()), SimpleSensor())\

    # FIX THIS !!
    classif_arg = def_value(classif_arg, [])
    for agent in agents:
        agent.set_state(SteelsAgentStateWithLexicon(classifier(*classif_arg)))
        agent.set_sensor(SimpleSensor())
        agent.set_fitness_measure("DG", metrics.get_DS_fitness())
        agent.set_fitness_measure("GG", metrics.get_CS_fitness())

    AdaptiveNetwork.def_alpha = float(alpha)
    AdaptiveNetwork.def_beta = float(beta)
    ReactiveUnit.def_sigma = float(sigma)
    DiscriminationGame.def_inc_category_treshold = float(inc_category_treshold)

    return steels_uniwersal_basic_experiment(num_iter, agents,
        GuessingGame(None, context_size), topology=topology,
            dump_freq=dump_freq, stimuli=stimuli)
コード例 #3
0
ファイル: steels_experiment.py プロジェクト: SylwiaT/cog-abm
 def __init__(self,  reactive_units=None, alpha=None, beta=None):
     """ Must be with weights !
     """
     self.units = def_value(reactive_units, [])
     self.alpha = np.longdouble(def_value(alpha, AdaptiveNetwork.def_alpha))
     self.beta = np.longdouble(def_value(beta, AdaptiveNetwork.def_beta))
コード例 #4
0
ファイル: steels_experiment.py プロジェクト: SylwiaT/cog-abm
 def __init__(self, context_len=4, inc_category_treshold=None):
     self.context_len = context_len
     self.inc_category_treshold = def_value(inc_category_treshold,
         DiscriminationGame.def_inc_category_treshold)
コード例 #5
0
ファイル: steels_experiment.py プロジェクト: SylwiaT/cog-abm
 def __init__(self, reactive_units=None, alpha=None, beta=None):
     """ Must be with weights !
     """
     self.units = def_value(reactive_units, [])
     self.alpha = np.longdouble(def_value(alpha, AdaptiveNetwork.def_alpha))
     self.beta = np.longdouble(def_value(beta, AdaptiveNetwork.def_beta))
コード例 #6
0
ファイル: steels_experiment.py プロジェクト: SylwiaT/cog-abm
 def __init__(self, context_len=4, inc_category_treshold=None):
     self.context_len = context_len
     self.inc_category_treshold = def_value(
         inc_category_treshold,
         DiscriminationGame.def_inc_category_treshold)