예제 #1
0
    def set_current_step(self, t):
        """
        Sets the current simulation step.

        **Warning:** can be dangerous for some spiking models.
        """
        Global.set_current_step(t, self.id)
예제 #2
0
    def set_current_step(self, t):
        """Sets the current simulation step.

        .. warning::

            Can be dangerous for some spiking models.
        """
        Global.set_current_step(t, self.id)
예제 #3
0
파일: IO.py 프로젝트: ANNarchy/ANNarchy
def load(filename, populations=True, projections=True, net_id=0):
    """
    Loads a saved state of the network.

    Warning: Matlab data can not be loaded.

    *Parameters*:

    * **filename**: the filename with relative or absolute path.

    * **populations**: if True, population data will be loaded (by default True)

    * **projections**: if True, projection data will be loaded (by default True)

    Example::

        load('results/network.npz')

    """

    desc = _load_data(filename)
    if desc is None:
        return

    if 'time_step' in desc.keys():
        Global.set_current_step(desc['time_step'], net_id)

    if populations:
        # Over all populations
        for pop in Global._network[net_id]['populations']:
            # check if the population is contained in save file
            if pop.name in desc.keys():
                pop._load_pop_data(desc[pop.name])

    if projections:
        for proj in Global._network[net_id]['projections'] :
            if proj.name in desc.keys():
                proj._load_proj_data(desc[proj.name])
예제 #4
0
def load(filename, populations=True, projections=True, net_id=0):
    """
    Loads a saved state of the network.

    Warning: Matlab data can not be loaded.

    *Parameters*:

    * **filename**: the filename with relative or absolute path.

    * **populations**: if True, population data will be loaded (by default True)

    * **projections**: if True, projection data will be loaded (by default True)

    Example::

        load('results/network.npz')

    """

    desc = _load_data(filename)
    if desc is None:
        return

    if 'time_step' in desc.keys():
        Global.set_current_step(desc['time_step'], net_id)

    if populations:
        # Over all populations
        for pop in Global._network[net_id]['populations']:
            # check if the population is contained in save file
            if pop.name in desc.keys():
                pop._load_pop_data(desc[pop.name])

    if projections:
        for proj in Global._network[net_id]['projections']:
            if proj.name in desc.keys():
                proj._load_proj_data(desc[proj.name])