def update(self, match_set):
assert isinstance(match_set, MatchSet)<EOL>assert match_set.model.algorithm is self<EOL>assert match_set.selected_action is not None<EOL>match_set.model.update_time_stamp()<EOL>action_set = match_set[match_set.selected_action]<EOL>average_time_passed = (<EOL>match_set.model.time_stamp -<EOL>self._get_average_time_stamp(action_set)<EOL>)<EOL>if average_time_passed <= self.ga_threshold:<EOL><INDENT>return<EOL><DEDENT>self._set_timestamps(action_set)<EOL>parent1 = self._select_parent(action_set)<EOL>parent2 = self._select_parent(action_set)<EOL>if random.random() < self.crossover_probability:<EOL><INDENT>condition1, condition2 = parent1.condition.crossover_with(<EOL>parent2.condition<EOL>)<EOL><DEDENT>else:<EOL><INDENT>condition1, condition2 = parent1.condition, parent2.condition<EOL><DEDENT>condition1 = self._mutate(condition1, action_set.situation)<EOL>condition2 = self._mutate(condition2, action_set.situation)<EOL>new_children = []<EOL>for condition in condition1, condition2:<EOL><INDENT>if self.do_ga_subsumption:<EOL><INDENT>subsumed = False<EOL>for parent in parent1, parent2:<EOL><INDENT>should_subsume = (<EOL>(parent.experience ><EOL>self.subsumption_threshold) and<EOL>parent.error < self.error_threshold and<EOL>parent.condition(condition)<EOL>)<EOL>if should_subsume:<EOL><INDENT>if parent in action_set.model:<EOL><INDENT>parent.numerosity += <NUM_LIT:1><EOL>self.prune(action_set.model)<EOL><DEDENT>else:<EOL><INDENT>parent.numerosity = <NUM_LIT:1><EOL>action_set.model.add(parent)<EOL><DEDENT>subsumed = True<EOL>break<EOL><DEDENT><DEDENT>if subsumed:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>child = XCSClassifierRule(<EOL>condition,<EOL>action_set.action,<EOL>self,<EOL>action_set.model.time_stamp<EOL>)<EOL>if child in action_set.model:<EOL><INDENT>action_set.model.add(child)<EOL><DEDENT>else:<EOL><INDENT>new_children.append(child)<EOL><DEDENT><DEDENT>if new_children:<EOL><INDENT>average_reward = <NUM_LIT> * (<EOL>parent1.average_reward +<EOL>parent2.average_reward<EOL>)<EOL>error = <NUM_LIT> * (parent1.error + parent2.error)<EOL>fitness = <NUM_LIT> * (<EOL>parent1.fitness +<EOL>parent2.fitness<EOL>)<EOL>for child in new_children:<EOL><INDENT>child.average_reward = average_reward<EOL>child.error = error<EOL>child.fitness = fitness<EOL>action_set.model.add(child)<EOL><DEDENT><DEDENT>
Update the classifier set from which the match set was drawn,
        e.g. by applying a genetic algorithm. The match_set argument is the
        MatchSet instance whose classifier set should be updated.

        Usage:
            match_set = model.match(situation)
            match_set.select_action()
            match_set.payoff = reward
            model.algorithm.distribute_payoff(match_set)
            model.algorithm.update(match_set)

        Arguments:
            match_set: A MatchSet instance for which the classifier set
                from which it was drawn needs to be updated based on the
                match set's payoff distribution.
        Return: None