Пример #1
0
 def __init__(self, state, step_profile):
     
     self.current_state = state
     '''
     The current state that will be crunched from on the next iteration.
     '''
     
     self._state_of_raw_generator = None
             
     assert garlicsim.misc.simpack_grokker.step_types.InplaceStepGenerator.\
            __instancecheck__(step_profile.step_function)
     
     self.step_function = step_profile.step_function
     '''The step function that will perform step for us.'''
     
     self.step_profile = step_profile
     '''
     The step profile which contains the arguments given to step function.
     '''
     
     self.auto_clock_generator = AutoClockGenerator(detect_static=True)
     '''Auto-clock generator which ensures all states have good `.clock`.'''
     
     self.auto_clock_generator.make_clock(self.current_state)
     
     self.__build_raw_generator()
Пример #2
0
 def __init__(self, state, step_profile):
     
     self.current_state = state
     '''
     The current state that will be crunched from on the next iteration.
     '''
     
     self.step_function = step_profile.step_function
     '''The step function that will produce states for us.'''
     
     self.step_profile = step_profile
     '''
     The step profile which contains the arguments given to step function.
     '''
     
     self.auto_clock_generator = AutoClockGenerator()
     '''Auto-clock generator which ensures all states have `.clock`.'''
     
     self.auto_clock_generator.make_clock(self.current_state)
Пример #3
0
    def __init__(self, history_browser, step_profile):

        assert isinstance(history_browser, garlicsim.misc.BaseHistoryBrowser)
        self.history_browser = history_browser
        '''The history browser that the history step function will use.'''

        self.history_step_function = step_profile.step_function
        '''The history step function that will produce states for us.'''

        self.step_profile = step_profile
        '''
        The step profile which contains the arguments given to step function.
        '''

        self.auto_clock_generator = AutoClockGenerator()
        '''Auto-clock generator which ensures all states have `.clock`.'''

        self.auto_clock_generator.make_clock(
            self.history_browser.get_last_state())