From d5959e4100b4a07ab1983d02b604597d11f6ade5 Mon Sep 17 00:00:00 2001 From: kmantel Date: Wed, 12 Apr 2017 15:06:29 -0400 Subject: [PATCH 001/781] get Scheduler from composition --- PsyNeuLink/scheduling/Scheduler.py | 217 ++++++++++++++++++++ PsyNeuLink/scheduling/__init__.py | 6 + PsyNeuLink/scheduling/condition.py | 315 +++++++++++++++++++++++++++++ setup.cfg | 9 +- 4 files changed, 545 insertions(+), 2 deletions(-) create mode 100644 PsyNeuLink/scheduling/Scheduler.py create mode 100644 PsyNeuLink/scheduling/__init__.py create mode 100644 PsyNeuLink/scheduling/condition.py diff --git a/PsyNeuLink/scheduling/Scheduler.py b/PsyNeuLink/scheduling/Scheduler.py new file mode 100644 index 00000000000..a6dc7ba5976 --- /dev/null +++ b/PsyNeuLink/scheduling/Scheduler.py @@ -0,0 +1,217 @@ +import logging + +from toposort import toposort + +from PsyNeuLink.Globals.TimeScale import TimeScale +from PsyNeuLink.scheduling.condition import ConditionSet, Never + +logger = logging.getLogger(__name__) + +class SchedulerError(Exception): + def __init__(self, error_value): + self.error_value = error_value + + def __str__(self): + return repr(self.error_value) + +class Scheduler(object): + def __init__(self, composition=None, condition_set=None, mechanisms=None, toposort_ordering=None): + ''' + :param self: + :param composition: (Composition) - the Composition this scheduler is scheduling for + :param condition_set: (ConditionSet) - a :keyword:`ConditionSet` to be scheduled + ''' + self.condition_set = condition_set if condition_set is not None else ConditionSet(scheduler=self) + # stores the in order list of self.run's yielded outputs + self.execution_list = [] + self.consideration_queue = [] + + if composition is not None: + self.mechanisms = [vert.mechanism for vert in composition.graph.vertices] + self._init_consideration_queue_from_composition(composition) + elif mechanisms is not None: + self.mechanisms = mechanisms + if toposort_ordering is None: + raise SchedulerError('Instantiating Scheduler by list of mechanisms requires a toposort ordering (kwarg toposort_ordering)') + self.consideration_queue = list(toposort_ordering) + else: + raise SchedulerError('Must instantiate a Scheduler with either a Composition (kwarg composition), or a list of Mechanisms (kwarg mechanisms) and and a toposort ordering over them (kwarg toposort_ordering)') + + self._init_counts() + + # the consideration queue is the ordered list of sets of nodes in the composition graph, by the + # order in which they should be checked to ensure that all parents have a chance to run before their children + def _init_consideration_queue_from_composition(self, composition): + dependencies = {} + for vert in composition.graph.vertices: + dependencies[vert.mechanism] = set() + for parent in composition.graph.get_parents(vert.mechanism): + dependencies[vert.mechanism].add(parent) + + self.consideration_queue = list(toposort(dependencies)) + logger.debug('Consideration queue: {0}'.format(self.consideration_queue)) + + def _init_counts(self): + # self.times[p][q] stores the number of TimeScale q ticks that have happened in the current TimeScale p + self.times = {ts: {ts: 0 for ts in TimeScale} for ts in TimeScale} + # stores total the number of occurrences of a mechanism through the time scale + # i.e. the number of times mech has ran/been queued to run in a trial + self.counts_total = {ts: None for ts in TimeScale} + # counts_useable is a dictionary intended to store the number of available "instances" of a certain mechanism that + # are available to expend in order to satisfy conditions such as "run B every two times A runs" + # specifically, counts_useable[a][b] = n indicates that there are n uses of a that are available for b to expend + # so, in the previous example B would check to see if counts_useable[A][B] is 2, in which case B can run + self.counts_useable = {mech: {m: 0 for m in self.mechanisms} for mech in self.mechanisms} + + for ts in TimeScale: + self.counts_total[ts] = {m: 0 for m in self.mechanisms} + + def _reset_count(self, count, time_scale): + for c in count[time_scale]: + count[time_scale][c] = 0 + + def _increment_time(self, time_scale): + for ts in TimeScale: + self.times[ts][time_scale] += 1 + + def _reset_time(self, time_scale): + for ts in TimeScale: + self.times[time_scale][ts] = 0 + + ################################################################################ + # Validation methods + # to provide the user with info if they do something odd + ################################################################################ + def _validate_run_state(self, termination_conds): + self._validate_condition_set() + self._validate_termination(termination_conds) + + def _validate_condition_set(self): + unspecified_mechs = [] + for mech in self.mechanisms: + if mech not in self.condition_set: + self.condition_set.add_condition(mech, Never()) + unspecified_mechs.append(mech) + if len(unspecified_mechs) > 0: + logger.warning('These mechanisms have no Conditions specified, and will NOT be scheduled: {0}'.format(unspecified_mechs)) + + def _validate_termination(self, termination_conds): + try: + for tc in termination_conds: + if termination_conds[tc] is None: + if tc in [TimeScale.RUN, TimeScale.TRIAL]: + raise SchedulerError('Must specify a {0} termination Condition (termination_conds[{0}]'.format(tc)) + else: + if termination_conds[tc].scheduler is None: + logger.debug('Setting scheduler of {0} to self ({1})'.format(termination_conds[tc], self)) + termination_conds[tc].scheduler = self + except TypeError as e: + raise SchedulerError('Must specify a termination Condition dict (termination_conds[]:Condition; err: {0}'.format(e)) + + ################################################################################ + # Run methods + ################################################################################ + def run(self, termination_conds={ts: None for ts in TimeScale}): + ''' + :param self: + :param termination_conds: (dict) - a mapping from :keyword:`TimeScale`s to :keyword:`Condition`s that when met terminate the execution of the specified :keyword:`TimeScale` + ''' + self._validate_run_state(termination_conds) + + def has_reached_termination(self, time_scale=None): + term = True + if time_scale is None: + for ts in termination_conds: + term = term and termination_conds[ts].is_satisfied() + else: + term = term and termination_conds[time_scale].is_satisfied() + + return term + + execution_list = [] + logger.debug('runterm: {0}'.format(termination_conds[TimeScale.RUN])) + self._reset_count(self.counts_total, TimeScale.RUN) + self._reset_time(TimeScale.RUN) + + while not termination_conds[TimeScale.RUN].is_satisfied(): + logger.debug('run, num trials in run: {0}'.format(self.times[TimeScale.RUN][TimeScale.TRIAL])) + self.counts_useable = {mech: {m: 0 for m in self.mechanisms} for mech in self.mechanisms} + self._reset_count(self.counts_total, TimeScale.TRIAL) + self._reset_time(TimeScale.TRIAL) + + while not termination_conds[TimeScale.TRIAL].is_satisfied() and not termination_conds[TimeScale.RUN].is_satisfied(): + self._reset_count(self.counts_total, TimeScale.PASS) + self._reset_time(TimeScale.PASS) + + execution_list_has_changed = False + cur_index_consideration_queue = 0 + + while ( + cur_index_consideration_queue < len(self.consideration_queue) + and not termination_conds[TimeScale.TRIAL].is_satisfied() + and not termination_conds[TimeScale.RUN].is_satisfied() + ): + cur_time_step_exec = set() + cur_consideration_set = self.consideration_queue[cur_index_consideration_queue] + logger.debug('trial, num passes in trial {0}, consideration_queue {1}'.format(self.times[TimeScale.TRIAL][TimeScale.PASS], ' '.join([str(x) for x in cur_consideration_set]))) + + # do-while, on cur_consideration_set_has_changed + while True: + cur_consideration_set_has_changed = False + for current_mech in cur_consideration_set: + logger.debug('cur time_step exec: {0}'.format(cur_time_step_exec)) + for m in self.counts_useable: + logger.debug('Counts of {0} useable by'.format(m)) + for m2 in self.counts_useable[m]: + logger.debug('\t{0}: {1}'.format(m2, self.counts_useable[m][m2])) + + if self.condition_set.conditions[current_mech].is_satisfied(): + if current_mech not in cur_time_step_exec: + logger.debug('adding {0} to execution list'.format(current_mech)) + logger.debug('cur time_step exec pre add: {0}'.format(cur_time_step_exec)) + cur_time_step_exec.add(current_mech) + logger.debug('cur time_step exec post add: {0}'.format(cur_time_step_exec)) + execution_list_has_changed = True + cur_consideration_set_has_changed = True + + for ts in TimeScale: + self.counts_total[ts][current_mech] += 1 + self.times[ts][TimeScale.TIME_STEP] += 1 + # current_mech's mechanism is added to the execution queue, so we now need to + # reset all of the counts useable by current_mech's mechanism to 0 + for m in self.counts_useable: + self.counts_useable[m][current_mech] = 0 + # and increment all of the counts of current_mech's mechanism useable by other + # mechanisms by 1 + for m in self.counts_useable: + self.counts_useable[current_mech][m] += 1 + # do-while condition + if not cur_consideration_set_has_changed: + break + + if len(cur_time_step_exec) >= 1: + if len(cur_time_step_exec) > 1: + self.execution_list.append(cur_time_step_exec) + else: + self.execution_list.append(cur_time_step_exec.pop()) + yield self.execution_list[-1] + + self._increment_time(TimeScale.TIME_STEP) + + cur_index_consideration_queue += 1 + + if not execution_list_has_changed: + self.execution_list.append(set()) + yield self.execution_list[-1] + + self._increment_time(TimeScale.TIME_STEP) + + # can execute the execution_list here + logger.debug(' '.join([str(x) for x in self.execution_list])) + self._increment_time(TimeScale.PASS) + + self._increment_time(TimeScale.TRIAL) + + self._increment_time(TimeScale.RUN) + + return self.execution_list diff --git a/PsyNeuLink/scheduling/__init__.py b/PsyNeuLink/scheduling/__init__.py new file mode 100644 index 00000000000..579b9b96445 --- /dev/null +++ b/PsyNeuLink/scheduling/__init__.py @@ -0,0 +1,6 @@ +import logging + +logging.basicConfig( + level=logging.WARNING, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' +) \ No newline at end of file diff --git a/PsyNeuLink/scheduling/condition.py b/PsyNeuLink/scheduling/condition.py new file mode 100644 index 00000000000..83b77aad882 --- /dev/null +++ b/PsyNeuLink/scheduling/condition.py @@ -0,0 +1,315 @@ +import logging + +from PsyNeuLink.Globals.TimeScale import TimeScale + +logger = logging.getLogger(__name__) + +class ConditionError(Exception): + def __init__(self, error_value): + self.error_value = error_value + + def __str__(self): + return repr(self.error_value) + +class ConditionSet(object): + def __init__(self, scheduler=None, conditions={}): + ''' + :param self: + :param scheduler: a :keyword:`Scheduler` that these conditions are associated with, which maintains any state necessary for these conditions + :param conditions: a :keyword:`dict` mapping :keyword:`Component`s to :keyword:`iterable`s of :keyword:`Condition`s, can be added later with :keyword:`add_condition` + ''' + self.scheduler = scheduler + # even though conditions may be added in arbitrary iterables, they are stored internally as dicts of sets + self.conditions = conditions + + def __contains__(self, item): + return item in self.conditions + + def add_condition(self, owner, condition): + ''' + :param: self: + :param owner: the :keyword:`Component` that is dependent on the :param conditions: + :param conditions: a :keyword:`Condition` (including All or Any) + ''' + logger.debug('add_condition: Setting scheduler of {0}, (owner {2}) to self.scheduler ({1})'.format(condition, self.scheduler, owner)) + condition.owner = owner + condition.scheduler = self.scheduler + self.conditions[owner] = condition + + def add_condition_set(self, conditions): + ''' + :param: self: + :param conditions: a :keyword:`dict` mapping :keyword:`Component`s to :keyword:`Condition`s, can be added later with :keyword:`add_condition` + ''' + for owner in conditions: + conditions[owner].owner = owner + conditions[owner].scheduler = self.scheduler + self.conditions[owner] = conditions[owner] + +class Condition(object): + def __init__(self, dependencies, func, *args, **kwargs): + ''' + :param self: + :param dependencies: one or more PNL objects over which func is evaluated to determine satisfaction of the :keyword:`Condition` + user must ensure that dependencies are suitable as func parameters + :param func: parameters over which func is evaluated to determine satisfaction of the :keyword:`Condition` + :param args: additional formal arguments passed to func + :param kwargs: additional keyword arguments passed to func + ''' + self.dependencies = dependencies + self.func = func + self.args = args + self.kwargs = kwargs + + self._scheduler = None + self._owner = None + #logger.debug('{1} dependencies: {0}'.format(dependencies, type(self).__name__)) + + @property + def scheduler(self): + return self._scheduler + + @scheduler.setter + def scheduler(self, value): + logger.debug('Condition ({0}) setting scheduler to {1}'.format(type(self).__name__, value)) + self._scheduler = value + + @property + def owner(self): + return self._owner + + @owner.setter + def owner(self, value): + logger.debug('Condition ({0}) setting owner to {1}'.format(type(self).__name__, value)) + self._owner = value + + def is_satisfied(self): + has_args = len(self.args) > 0 + has_kwargs = len(self.kwargs) > 0 + + if has_args and has_kwargs: + return self.func(self.dependencies, *self.args, **self.kwargs) + if has_args: + return self.func(self.dependencies, *self.args) + if has_kwargs: + return self.func(self.dependencies, **self.kwargs) + return self.func(self.dependencies) + +###################################################################### +# Included Conditions +###################################################################### + +# TODO: create this class to subclass All and Any from +#class CompositeCondition(Condition): + #def + +class All(Condition): + def __init__(self, *args): + ''' + :param self: + :param args: one or more :keyword:`Condition`s, all of which must be satisfied to satisfy this composite condition + to initialize with a list (for example), + conditions = [AfterNCalls(mechanism, 5) for mechanism in mechanism_list] + unpack the list to supply its members as args + composite_condition = All(*conditions) + ''' + super().__init__(args, self.satis) + + @Condition.scheduler.setter + def scheduler(self, value): + for cond in self.dependencies: + logger.debug('schedule setter: Setting scheduler of {0} to ({1})'.format(cond, value)) + if cond.scheduler is None: + cond.scheduler = value + + @Condition.owner.setter + def owner(self, value): + for cond in self.dependencies: + logger.debug('owner setter: Setting owner of {0} to ({1})'.format(cond, value)) + if cond.owner is None: + cond.owner = value + + def satis(self, conds): + for cond in conds: + if not cond.is_satisfied(): + return False + return True + +class Any(Condition): + def __init__(self, *args): + ''' + :param self: + :param args: one or more :keyword:`Condition`s, any of which must be satisfied to satisfy this composite condition + to initialize with a list (for example), + conditions = [AfterNCalls(mechanism, 5) for mechanism in mechanism_list] + unpack the list to supply its members as args + composite_condition = All(*conditions) + ''' + super().__init__(args, self.satis) + + @Condition.scheduler.setter + def scheduler(self, value): + logger.debug('Any setter args: {0}'.format(self.dependencies)) + for cond in self.dependencies: + logger.debug('schedule setter: Setting scheduler of {0} to ({1})'.format(cond, value)) + if cond.scheduler is None: + cond.scheduler = value + + @Condition.owner.setter + def owner(self, value): + for cond in self.dependencies: + logger.debug('owner setter: Setting owner of {0} to ({1})'.format(cond, value)) + if cond.owner is None: + cond.owner = value + + def satis(self, conds): + for cond in conds: + if cond.is_satisfied(): + return True + return False + +class Not(Condition): + def __init__(self, condition): + super().__init__(condition, lambda c: not c.is_satisfied()) + + @Condition.scheduler.setter + def scheduler(self, value): + self.dependencies.scheduler = value + + @Condition.owner.setter + def owner(self, value): + self.dependencies.owner = value + +class Always(Condition): + def __init__(self): + super().__init__(True, lambda x: x) + +class Never(Condition): + def __init__(self): + super().__init__(False, lambda x: x) + +class AtPass(Condition): + def __init__(self, n, time_scale=TimeScale.TRIAL): + def func(n): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + try: + return self.scheduler.times[time_scale][TimeScale.PASS] == n + except KeyError as e: + raise ConditionError('{0}: {1}, is time_scale set correctly? Currently: {2}'.format(type(self).__name__, e, time_scale)) + super().__init__(n, func) + +class AfterPass(Condition): + def __init__(self, n, time_scale=TimeScale.TRIAL): + def func(n, time_scale): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + return self.scheduler.times[time_scale][TimeScale.PASS] >= n+1 + super().__init__(n, func, time_scale) + +class AfterNCalls(Condition): + def __init__(self, dependency, n, time_scale=TimeScale.TRIAL): + def func(dependency, n): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + num_calls = self.scheduler.counts_total[time_scale][dependency] + logger.debug('{0} has reached {1} num_calls in {2}'.format(dependency, num_calls, time_scale.name)) + return num_calls >= n + super().__init__(dependency, func, n) + +class AfterNCallsCombined(Condition): + def __init__(self, *dependencies, n=None, time_scale=TimeScale.TRIAL): + logger.debug('{0} args: deps {1}, n {2}, ts {3}'.format(type(self).__name__, dependencies, n, time_scale)) + def func(_none, *dependencies, n=None): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + if n is None: + raise ConditionError('{0}: keyword argument n is None'.format(type(self).__name__)) + count_sum = 0 + for d in dependencies: + count_sum += self.scheduler.counts_total[time_scale][d] + logger.debug('{0} has reached {1} num_calls in {2}'.format(d, self.scheduler.counts_total[time_scale][d], time_scale.name)) + return count_sum >= n + super().__init__(None, func, *dependencies, n=n) + +class AfterNTrials(Condition): + def __init__(self, n, time_scale=TimeScale.RUN): + def func(n, time_scale): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + return self.scheduler.times[time_scale][TimeScale.TRIAL] >= n + super().__init__(n, func, time_scale) + +class BeforePass(Condition): + def __init__(self, n, time_scale=TimeScale.TRIAL): + def func(n, time_scale): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + return self.scheduler.times[time_scale][TimeScale.PASS] < n + super().__init__(n, func, time_scale) + +class EveryNPasses(Condition): + def __init__(self, n, time_scale=TimeScale.TRIAL): + def func(n, time_scale): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + return self.scheduler.times[time_scale][TimeScale.PASS] % n == 0 + super().__init__(n, func, time_scale) + +class EveryNCalls(Condition): + def __init__(self, dependency, n): + def func(dependency, n): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + num_calls = self.scheduler.counts_useable[dependency][self.owner] + logger.debug('{0} has reached {1} num_calls'.format(dependency, num_calls)) + return num_calls >= n + super().__init__(dependency, func, n) + +class JustRan(Condition): + def __init__(self, dependency): + def func(dependency): + if self.scheduler is None: + raise ConditionError('{0}: self.scheduler is None - scheduler must be assigned'.format(type(self).__name__)) + logger.debug('checking if {0} in previous execution step set'.format(dependency)) + try: + return dependency in self.scheduler.execution_list[-1] + except TypeError: + return dependency == self.scheduler.execution_list[-1] + super().__init__(dependency, func) + +class WhenFinished(Condition): + def __init__(self, dependency): + def func(dependency): + try: + return dependency.is_finished + except AttributeError as e: + raise ConditionError('WhenFinished: Unsupported dependency type: {0}; ({1})'.format(type(dependency), e)) + + super().__init__(dependency, func) + +class WhenFinishedAny(Condition): + def __init__(self, *dependencies): + def func(_none, *dependencies): + for d in dependencies: + try: + if d.is_finished: + return True + except AttributeError as e: + raise ConditionError('WhenFinishedAny: Unsupported dependency type: {0}; ({1})'.format(type(dependency), e)) + return False + + super().__init__(None, *dependencies, func) + +class WhenFinishedAll(Condition): + def __init__(self, *dependencies): + def func(_none, *dependencies): + for d in dependencies: + try: + if not d.is_finished: + return False + except AttributeError as e: + raise ConditionError('WhenFinishedAll: Unsupported dependency type: {0}; ({1})'.format(type(dependency), e)) + return True + + super().__init__(None, func, *dependencies) diff --git a/setup.cfg b/setup.cfg index 388185661bf..4f772de452c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,17 @@ -[pytest] +[tool:pytest] addopts = + --pyargs PsyNeuLink + -s # --junitxml=junit-results.xml # --cov-report=xml --cov-report=html --cov-report=term +pytest_plugins = ['pytest_profiling'] + [coverage:run] branch = True [coverage:report] -fail_under = 90 \ No newline at end of file +fail_under = 90 + From d46543321c0bbcebfe43bdae4c208b7941ebde93 Mon Sep 17 00:00:00 2001 From: KristenManning Date: Wed, 12 Apr 2017 15:51:44 -0400 Subject: [PATCH 002/781] created a 'mechanism generator' to serve as a simplified scheduler for testing purposes; gets passed to system as a 'scheduler' in the user's script --- .idea/runConfigurations/_Scratch_Pad.xml | 3 +- PsyNeuLink/Components/System.py | 9 +- PsyNeuLink/Globals/Keywords.py | 1 + PsyNeuLink/Globals/Utilities.py | 1 - PsyNeuLink/mechanismGenerator.py | 21 + .../mechanism-generator-test.py | 59 + docs/build/doctrees/AdaptiveMechanism.doctree | Bin 0 -> 5196 bytes docs/build/doctrees/Component.doctree | Bin 0 -> 59846 bytes docs/build/doctrees/ControlMechanism.doctree | Bin 0 -> 5174 bytes docs/build/doctrees/ControlProjection.doctree | Bin 0 -> 6017 bytes docs/build/doctrees/ControlSignal.doctree | Bin 0 -> 3473 bytes docs/build/doctrees/DDM.doctree | Bin 0 -> 88099 bytes .../doctrees/DefaultControlMechanism.doctree | Bin 0 -> 3257 bytes docs/build/doctrees/Defaults.doctree | Bin 0 -> 5128 bytes docs/build/doctrees/EVCMechanism.doctree | Bin 0 -> 3515 bytes docs/build/doctrees/Function.doctree | Bin 0 -> 753225 bytes docs/build/doctrees/InputState.doctree | Bin 0 -> 62825 bytes .../doctrees/IntegratorMechanism.doctree | Bin 0 -> 55473 bytes docs/build/doctrees/Keywords.doctree | Bin 0 -> 42350 bytes docs/build/doctrees/LearningMechanism.doctree | Bin 0 -> 187616 bytes .../build/doctrees/LearningProjection.doctree | Bin 0 -> 84713 bytes docs/build/doctrees/Log.doctree | Bin 0 -> 89310 bytes docs/build/doctrees/MappingProjection.doctree | Bin 0 -> 85247 bytes docs/build/doctrees/Mechanism.doctree | Bin 0 -> 246208 bytes .../build/doctrees/ObjectiveMechanism.doctree | Bin 0 -> 113352 bytes docs/build/doctrees/OutputState.doctree | Bin 0 -> 133524 bytes docs/build/doctrees/ParameterState.doctree | Bin 0 -> 138948 bytes docs/build/doctrees/Preferences.doctree | Bin 0 -> 3022 bytes docs/build/doctrees/Process.doctree | Bin 0 -> 4538 bytes .../doctrees/ProcessingMechanism.doctree | Bin 0 -> 13035 bytes docs/build/doctrees/Projection.doctree | Bin 0 -> 86496 bytes docs/build/doctrees/Run.doctree | Bin 0 -> 4526 bytes docs/build/doctrees/State.doctree | Bin 0 -> 53219 bytes docs/build/doctrees/System.doctree | Bin 0 -> 4643 bytes docs/build/doctrees/TimeScale.doctree | Bin 0 -> 6180 bytes docs/build/doctrees/TransferMechanism.doctree | Bin 0 -> 101381 bytes docs/build/doctrees/Utilities.doctree | Bin 0 -> 64639 bytes docs/build/doctrees/environment.pickle | Bin 0 -> 134042 bytes docs/build/doctrees/globals.doctree | Bin 0 -> 3072 bytes docs/build/doctrees/index.doctree | Bin 0 -> 91291 bytes docs/build/html/.buildinfo | 4 +- docs/build/html/AdaptiveMechanism.html | 263 + docs/build/html/Component.html | 427 + docs/build/html/ControlMechanism.html | 151 +- docs/build/html/ControlProjection.html | 195 +- docs/build/html/ControlSignal.html | 269 + docs/build/html/DDM.html | 89 +- docs/build/html/DefaultControlMechanism.html | 67 +- docs/build/html/Defaults.html | 49 +- docs/build/html/EVCMechanism.html | 67 +- docs/build/html/Function.html | 535 +- docs/build/html/InputState.html | 67 +- docs/build/html/IntegratorMechanism.html | 91 +- docs/build/html/Keywords.html | 63 +- docs/build/html/LearningMechanism.html | 685 ++ docs/build/html/LearningProjection.html | 122 +- docs/build/html/Log.html | 111 +- docs/build/html/MappingProjection.html | 67 +- docs/build/html/Mechanism.html | 115 +- docs/build/html/ObjectiveMechanism.html | 533 + docs/build/html/OutputState.html | 73 +- docs/build/html/ParameterState.html | 73 +- docs/build/html/Preferences.html | 49 +- docs/build/html/Process.html | 715 +- docs/build/html/ProcessingMechanism.html | 55 +- docs/build/html/Projection.html | 86 +- docs/build/html/Run.html | 361 +- docs/build/html/State.html | 53 +- docs/build/html/System.html | 690 +- docs/build/html/TimeScale.html | 49 +- docs/build/html/TransferMechanism.html | 81 +- docs/build/html/Utilities.html | 66 +- ...rningMechanism_Multilayer_Learning_fig.pdf | Bin 0 -> 71349 bytes ...ingMechanism_Single_Layer_Learning_fig.pdf | Bin 0 -> 67785 bytes ...arningMechanism_TERMINAL_vs_TARGET_fig.pdf | Bin 0 -> 39008 bytes .../html/_images/Mechanism_states_fig.jpg | Bin 0 -> 215065 bytes .../build/html/_images/ParameterState_fig.jpg | Bin 0 -> 133870 bytes docs/build/html/_images/System_simple_fig.jpg | Bin 0 -> 136194 bytes .../html/_sources/AdaptiveMechanism.rst.txt | 12 + docs/build/html/_sources/Component.rst.txt | 7 + .../html/_sources/ControlMechanism.rst.txt | 12 + .../html/_sources/ControlProjection.rst.txt | 9 + .../build/html/_sources/ControlSignal.rst.txt | 9 + docs/build/html/_sources/DDM.rst.txt | 11 + .../_sources/DefaultControlMechanism.rst.txt | 5 + docs/build/html/_sources/Defaults.rst.txt | 8 + docs/build/html/_sources/EVCMechanism.rst.txt | 12 + docs/build/html/_sources/Function.rst.txt | 30 + docs/build/html/_sources/InputState.rst.txt | 6 + .../html/_sources/IntegratorMechanism.rst.txt | 12 + docs/build/html/_sources/Keywords.rst.txt | 6 + .../html/_sources/LearningMechanism.rst.txt | 11 + .../html/_sources/LearningProjection.rst.txt | 6 + docs/build/html/_sources/Log.rst.txt | 11 + .../html/_sources/MappingProjection.rst.txt | 6 + docs/build/html/_sources/Mechanism.rst.txt | 16 + .../html/_sources/ObjectiveMechanism.rst.txt | 6 + docs/build/html/_sources/OutputState.rst.txt | 6 + .../html/_sources/ParameterState.rst.txt | 11 + docs/build/html/_sources/Preferences.rst.txt | 7 + docs/build/html/_sources/Process.rst.txt | 11 + .../html/_sources/ProcessingMechanism.rst.txt | 14 + docs/build/html/_sources/Projection.rst.txt | 15 + docs/build/html/_sources/Run.rst.txt | 11 + docs/build/html/_sources/State.rst.txt | 17 + docs/build/html/_sources/System.rst.txt | 11 + docs/build/html/_sources/TimeScale.rst.txt | 9 + .../html/_sources/TransferMechanism.rst.txt | 11 + docs/build/html/_sources/Utilities.rst.txt | 15 + docs/build/html/_sources/globals.rst.txt | 1 + docs/build/html/_sources/index.rst.txt | 305 + ...rningMechanism_Multilayer_Learning_fig.pdf | Bin 0 -> 71349 bytes ...ingMechanism_Single_Layer_Learning_fig.pdf | Bin 0 -> 67785 bytes ...arningMechanism_TERMINAL_vs_TARGET_fig.pdf | Bin 0 -> 39008 bytes ...LearningProjection_Simple_Learning_fig.jpg | Bin 0 -> 107980 bytes ...rningProjection_TERMINAL_vs_TARGET_fig.jpg | Bin 0 -> 192157 bytes .../html/_static/Mechanism_states_fig.jpg | Bin 0 -> 215065 bytes .../build/html/_static/ParameterState_fig.jpg | Bin 0 -> 133870 bytes docs/build/html/_static/System_simple_fig.jpg | Bin 0 -> 136194 bytes docs/build/html/_static/basic.css | 59 +- docs/build/html/_static/comment-bright.png | Bin 3500 -> 756 bytes docs/build/html/_static/comment-close.png | Bin 3578 -> 829 bytes docs/build/html/_static/comment.png | Bin 3445 -> 641 bytes docs/build/html/_static/css/badge_only.css | 2 +- docs/build/html/_static/css/theme.css | 4 +- docs/build/html/_static/doctools.js | 2 +- docs/build/html/_static/down-pressed.png | Bin 347 -> 222 bytes docs/build/html/_static/down.png | Bin 347 -> 202 bytes docs/build/html/_static/file.png | Bin 358 -> 286 bytes .../html/_static/fonts/Inconsolata-Bold.ttf | Bin 66352 -> 109948 bytes .../_static/fonts/Inconsolata-Regular.ttf | Bin 84548 -> 96964 bytes docs/build/html/_static/fonts/Lato-Bold.ttf | Bin 121788 -> 656544 bytes .../build/html/_static/fonts/Lato-Regular.ttf | Bin 120196 -> 656568 bytes .../_static/fonts/fontawesome-webfont.eot | Bin 56006 -> 76518 bytes .../_static/fonts/fontawesome-webfont.svg | 207 +- .../_static/fonts/fontawesome-webfont.ttf | Bin 112160 -> 152796 bytes .../_static/fonts/fontawesome-webfont.woff | Bin 65452 -> 90412 bytes docs/build/html/_static/jquery-3.1.0.js | 10074 ++++++++++++++++ docs/build/html/_static/jquery.js | 8 +- docs/build/html/_static/js/theme.js | 58 +- docs/build/html/_static/minus.png | Bin 173 -> 90 bytes docs/build/html/_static/plus.png | Bin 173 -> 90 bytes docs/build/html/_static/pygments.css | 4 + docs/build/html/_static/searchtools.js | 117 +- docs/build/html/_static/up-pressed.png | Bin 345 -> 214 bytes docs/build/html/_static/up.png | Bin 345 -> 203 bytes docs/build/html/_static/websupport.js | 2 +- docs/build/html/genindex.html | 2859 ++--- docs/build/html/globals.html | 49 +- docs/build/html/index.html | 91 +- docs/build/html/objects.inv | Bin 5758 -> 4857 bytes docs/build/html/py-modindex.html | 81 +- docs/build/html/search.html | 43 +- docs/build/html/searchindex.js | 2 +- 154 files changed, 16197 insertions(+), 4519 deletions(-) create mode 100644 PsyNeuLink/mechanismGenerator.py create mode 100644 Scripts/MISCELLANEOUS SCRIPTS/mechanism-generator-test.py create mode 100644 docs/build/doctrees/AdaptiveMechanism.doctree create mode 100644 docs/build/doctrees/Component.doctree create mode 100644 docs/build/doctrees/ControlMechanism.doctree create mode 100644 docs/build/doctrees/ControlProjection.doctree create mode 100644 docs/build/doctrees/ControlSignal.doctree create mode 100644 docs/build/doctrees/DDM.doctree create mode 100644 docs/build/doctrees/DefaultControlMechanism.doctree create mode 100644 docs/build/doctrees/Defaults.doctree create mode 100644 docs/build/doctrees/EVCMechanism.doctree create mode 100644 docs/build/doctrees/Function.doctree create mode 100644 docs/build/doctrees/InputState.doctree create mode 100644 docs/build/doctrees/IntegratorMechanism.doctree create mode 100644 docs/build/doctrees/Keywords.doctree create mode 100644 docs/build/doctrees/LearningMechanism.doctree create mode 100644 docs/build/doctrees/LearningProjection.doctree create mode 100644 docs/build/doctrees/Log.doctree create mode 100644 docs/build/doctrees/MappingProjection.doctree create mode 100644 docs/build/doctrees/Mechanism.doctree create mode 100644 docs/build/doctrees/ObjectiveMechanism.doctree create mode 100644 docs/build/doctrees/OutputState.doctree create mode 100644 docs/build/doctrees/ParameterState.doctree create mode 100644 docs/build/doctrees/Preferences.doctree create mode 100644 docs/build/doctrees/Process.doctree create mode 100644 docs/build/doctrees/ProcessingMechanism.doctree create mode 100644 docs/build/doctrees/Projection.doctree create mode 100644 docs/build/doctrees/Run.doctree create mode 100644 docs/build/doctrees/State.doctree create mode 100644 docs/build/doctrees/System.doctree create mode 100644 docs/build/doctrees/TimeScale.doctree create mode 100644 docs/build/doctrees/TransferMechanism.doctree create mode 100644 docs/build/doctrees/Utilities.doctree create mode 100644 docs/build/doctrees/environment.pickle create mode 100644 docs/build/doctrees/globals.doctree create mode 100644 docs/build/doctrees/index.doctree create mode 100644 docs/build/html/AdaptiveMechanism.html create mode 100644 docs/build/html/Component.html create mode 100644 docs/build/html/ControlSignal.html create mode 100644 docs/build/html/LearningMechanism.html create mode 100644 docs/build/html/ObjectiveMechanism.html create mode 100644 docs/build/html/_images/LearningMechanism_Multilayer_Learning_fig.pdf create mode 100644 docs/build/html/_images/LearningMechanism_Single_Layer_Learning_fig.pdf create mode 100644 docs/build/html/_images/LearningMechanism_TERMINAL_vs_TARGET_fig.pdf create mode 100644 docs/build/html/_images/Mechanism_states_fig.jpg create mode 100644 docs/build/html/_images/ParameterState_fig.jpg create mode 100644 docs/build/html/_images/System_simple_fig.jpg create mode 100644 docs/build/html/_sources/AdaptiveMechanism.rst.txt create mode 100644 docs/build/html/_sources/Component.rst.txt create mode 100644 docs/build/html/_sources/ControlMechanism.rst.txt create mode 100644 docs/build/html/_sources/ControlProjection.rst.txt create mode 100644 docs/build/html/_sources/ControlSignal.rst.txt create mode 100644 docs/build/html/_sources/DDM.rst.txt create mode 100644 docs/build/html/_sources/DefaultControlMechanism.rst.txt create mode 100644 docs/build/html/_sources/Defaults.rst.txt create mode 100644 docs/build/html/_sources/EVCMechanism.rst.txt create mode 100644 docs/build/html/_sources/Function.rst.txt create mode 100644 docs/build/html/_sources/InputState.rst.txt create mode 100644 docs/build/html/_sources/IntegratorMechanism.rst.txt create mode 100644 docs/build/html/_sources/Keywords.rst.txt create mode 100644 docs/build/html/_sources/LearningMechanism.rst.txt create mode 100644 docs/build/html/_sources/LearningProjection.rst.txt create mode 100644 docs/build/html/_sources/Log.rst.txt create mode 100644 docs/build/html/_sources/MappingProjection.rst.txt create mode 100644 docs/build/html/_sources/Mechanism.rst.txt create mode 100644 docs/build/html/_sources/ObjectiveMechanism.rst.txt create mode 100644 docs/build/html/_sources/OutputState.rst.txt create mode 100644 docs/build/html/_sources/ParameterState.rst.txt create mode 100644 docs/build/html/_sources/Preferences.rst.txt create mode 100644 docs/build/html/_sources/Process.rst.txt create mode 100644 docs/build/html/_sources/ProcessingMechanism.rst.txt create mode 100644 docs/build/html/_sources/Projection.rst.txt create mode 100644 docs/build/html/_sources/Run.rst.txt create mode 100644 docs/build/html/_sources/State.rst.txt create mode 100644 docs/build/html/_sources/System.rst.txt create mode 100644 docs/build/html/_sources/TimeScale.rst.txt create mode 100644 docs/build/html/_sources/TransferMechanism.rst.txt create mode 100644 docs/build/html/_sources/Utilities.rst.txt create mode 100644 docs/build/html/_sources/globals.rst.txt create mode 100644 docs/build/html/_sources/index.rst.txt create mode 100644 docs/build/html/_static/LearningMechanism_Multilayer_Learning_fig.pdf create mode 100644 docs/build/html/_static/LearningMechanism_Single_Layer_Learning_fig.pdf create mode 100644 docs/build/html/_static/LearningMechanism_TERMINAL_vs_TARGET_fig.pdf create mode 100644 docs/build/html/_static/LearningProjection_Simple_Learning_fig.jpg create mode 100644 docs/build/html/_static/LearningProjection_TERMINAL_vs_TARGET_fig.jpg create mode 100644 docs/build/html/_static/Mechanism_states_fig.jpg create mode 100644 docs/build/html/_static/ParameterState_fig.jpg create mode 100644 docs/build/html/_static/System_simple_fig.jpg create mode 100644 docs/build/html/_static/jquery-3.1.0.js diff --git a/.idea/runConfigurations/_Scratch_Pad.xml b/.idea/runConfigurations/_Scratch_Pad.xml index 9ca8073c30e..60d3ca68c9d 100644 --- a/.idea/runConfigurations/_Scratch_Pad.xml +++ b/.idea/runConfigurations/_Scratch_Pad.xml @@ -14,7 +14,6 @@