def __init__(self, name, rude, loud, big, foul):

        super().__init__(name, strict_engine=True)

        resource = Resource('Storage', ('item_1', 'item_2', 'External gene'))
        resource.set_values([2, 4, 0])
        essence = Essence('Persona', ('rude', 'loud', 'big', 'foul'))
        essence.set_values([rude, loud, big, foul])

        self.set_scaffolds(resource, essence)

        buzz = Buzz('Env Feeling', ('gene_bump', ))
        belief = Belief('Gene in Env', ('yes_no', ))
        interpreter = Interpreter('Is gene in env?', lambda x: x, buzz, belief)
        direction_r = Direction('Receive', ('yes_no', ))
        moulder_r = Moulder('Receive gene', lambda x: x, belief, direction_r)
        belief_eject = Belief('Time to eject', ('yes_no', ))
        direction_e = Direction('Eject', ('payload', ))
        r1_map = ResourceMap('item1', 'delta', 'item_1', ('value', ))
        r2_map = ResourceMap('item2', 'delta', 'item_2', ('value', ))
        r_map = MapCollection([r1_map, r2_map])
        moulder_e = Moulder('Eject gene', self.ejector, belief_eject,
                            direction_e, r_map)
        consume_payload = ResourceMap('consume', 'reset', 'External gene',
                                      ('value', ))
        moulder_cross = Moulder('Make cross-over baby', self.make_baby, None,
                                direction_e, consume_payload)

        self.set_organs(interpreter, moulder_r, moulder_e, moulder_cross)
        self.set_messages(buzz, belief, direction_r, direction_e)
def test_main():
    #
    # Define Messages
    #
    belief = Belief('stressed', ('degree', ))
    belief.set_values(10.0)
    direction1 = Direction('collect_amount', ('intake_volume', ))

    #
    # Define Scaffold and Map for it
    #
    agent_resources = Resource('internal_molecules', ('A', 'B', 'C'))
    agent_resources.set_values([2.0, 1.0, 0.5])
    added_a = ResourceMap('get_A', 'delta_scale', 'A', (
        'add',
        'dilute',
    ))
    added_b = ResourceMap('get_B', 'delta_scale', 'B', (
        'add',
        'dilute',
    ))
    added_c = ResourceMap('get_C', 'delta_scale', 'C', (
        'add',
        'dilute',
    ))
    add_internal = MapCollection([added_a, added_b, added_c])

    #
    # Define Organs and their associated messages
    #
    moulder1 = Moulder('discard_or_not', make_decision, belief, direction1)

    env = Env()
    actuator1 = Actuator('collect', env.excretor, direction1, add_internal)

    #
    # Initialize Agent
    #
    agent = Agent('test_agent', strict_engine=True)
    agent.set_organ(moulder1)
    agent.set_organ(actuator1)
    agent.set_scaffold(agent_resources)

    #
    # Decide on direction and execute action
    #
    agent.mould('discard_or_not')
    agent.act('collect')

    for mol in REF:
        assert (isclose(REF[mol], agent.resource[mol], abs_tol=0.0001))

    try:
        agent.act('collect')
        raise AssertionError(
            'Acting twice in sequence did not raise correct exception')
    except EmptyFlashError:
        pass
Beispiel #3
0
def test_main():
    resource = Resource('harvest', ('wheat', 'rye', 'barley', 'oats'))
    resource.set_values([35.0, 12.0, 8.0, 6.0])
    agent1 = Agent('farmer Joe', strict_engine=True)
    agent1.set_scaffold(resource)

    resource = Resource('food producer', ('wheat', 'rye', 'barley', 'oats',
                                          'cash_on_hand'))
    resource.set_values([0.0, 0.0, 0.0, 0.0, 100.0])
    agent2 = Agent('yummy Inc', strict_engine=True)
    agent2.set_scaffold(resource)

    ams = AgentManagementSystem('food market', [agent1, agent2])
    uuid_of_yummy = list(ams.agents_in_scope.values())[1].agent_id_system

    mapper = ResourceMap('cash loss', 'scale', 'cash_on_hand', ('factor',))
    amort = Compulsion('amortization', interest_rate, mapper)
    ams.set_law(amort)

    mapper_wheat = ResourceMap('loss of wheat', 'scale', 'wheat', ('factor',))
    mapper_rye = ResourceMap('loss of rye', 'scale', 'rye', ('factor',))
    mapper_barley = ResourceMap('loss of barley', 'scale', 'barley', ('factor',))
    mapper_oats = ResourceMap('loss of oats', 'scale', 'oats', ('factor',))
    mapper_cereal = MapCollection([mapper_wheat, mapper_rye, mapper_barley, mapper_oats])
    sloppy = Compulsion('sloppy', lambda : 4*[0.88], mapper_cereal)
    ams.set_law(sloppy)

    ams.make_lawbook_entry(['sloppy'], agent_name_selector=farm_name_test)
    ams.make_lawbook_entry(['amortization'], agent_ids=[uuid_of_yummy])

    for agent in ams.cycle_nodes(True, 2):
        ams.engage_all_verbs(agent, validate_lawbook=True)

    vals1 = agent1.resource.values()
    vals2 = agent2.resource.values()

    assert (vals1 == REF1)
    assert (vals2 == REF2)

    ams.compel(agent2, 'sloppy')

    try:
        ams.compel(agent2, 'sloppy', validate_lawbook=True)
    except RuntimeError as e:
        if 'Compulsion sloppy is not in law book' in str(e):
            pass
        else:
            raise AssertionError('Exception was not properly raised')

    try:
        ams.compel(agent1, 'amortization')
    except KeyError as e:
        if 'cash_on_hand' in str(e):
            pass
        else:
            raise AssertionError('Exception was not properly raised')
def test_main():
    resource = Resource('poison in body', ['amount', 'kind'])
    resource.set_values([10.0, 'mercury'])

    agent = Agent('thin agent', strict_engine=True)
    agent.set_scaffold(resource)

    ams = AgentManagementSystem('exterior laws', [agent])

    mapper = ResourceMap('scale down', 'scale', 'amount', ('factor', ))
    kwargs = {
        'poison_amount_getter': lambda: agent.resource['amount'],
        'doodle': 2.0
    }
    compulsion = Compulsion('natural decay',
                            simple_decline,
                            mapper,
                            compel_func_kwargs=kwargs)
    ams.set_law(compulsion)

    count = 0
    for agent in ams.shuffle_nodes(True, 5, False):
        before = agent.resource['amount']
        ams.compel(agent, 'natural decay')
        after = agent.resource['amount']
        assert (before == REF[count][0])
        assert (after == REF[count][1])
        count += 1
    def __init__(self, name, agents, env_atom):

        super().__init__(name, agents, agent_env=env_atom)

        for agent in agents:
            sensor = Sensor('Feel for gene in Env',
                            self.feeler,
                            agent.buzz['Env Feeling'],
                            agent_id_to_engine=True)
            stuff = ResourceMap('Env Payload', 'reset', 'External gene',
                                ('item', ))
            actuator_r = Actuator('Suck up gene',
                                  self.retriever,
                                  agent.direction['Receive'],
                                  stuff,
                                  agent_id_to_engine=True)
            actuator_e = Actuator('Eject gene',
                                  self.ejecter,
                                  agent.direction['Eject'],
                                  agent_id_to_engine=True)
            actuator_b = Actuator('Birth baby',
                                  self.birth,
                                  agent.direction['Eject'],
                                  agent_id_to_engine=True)
            agent.set_organs(sensor, actuator_r, actuator_e, actuator_b)
    def ejector(self, should_eject):

        e_map = universal_map_maker(self.essence, 'reset', ('value', ))
        e_map.set_values(self.essence.values())

        r1_map = ResourceMap('item1', 'delta', 'item_1', ('value', ))
        r2_map = ResourceMap('item2', 'delta', 'item_2', ('value', ))
        r_map = MapCollection([r1_map, r2_map])

        split_half = [
            x / 2.0 for key, x in self.resource.items() if 'item' in key
        ]
        r_map.set_values(split_half)

        ret = [(e_map, r_map)]
        ret.extend([-1.0 * x for x in split_half])

        return tuple(ret)
Beispiel #7
0
def test_main():

    # Not fully implemented
    assert 1==2

    battery = Resource('battery power', ('potential',))
    battery.set_values(0.401)
    suck_power = ResourceMap('suck power', 'delta', 'potential', ('reduction',))
    b1 = Buzz('sound stimulation', ('band_1', 'band_2', 'band_3'))
    s1 = Sensor('sound in surrounding', listen, b1, suck_power)
    belief_1 = Belief('The word was spoken', ('probability',))
    int1 = Interpreter('Was the word spoken?', word_estimator, b1, belief_1)
    dir_1 = Direction('follow up request', ('word_section_1', 'word_section_2',
                                            'word_section_3', 'word_section_4'))
    moul1 = Moulder('What response to give', responder, belief_1, dir_1)
    a1 = Actuator('loudspeaker vibrations', loudspeaker_api, dir_1, suck_power)
    moul2 = Moulder('Select warn statement', warn_statement, None, dir_1,
                    resource_op_input=battery)

    bc = AutoBeliefCondition('Sufficiently confident of word spoken',
                             lambda p: p > 0.75, 'The word was spoken')
    rc = AutoResourceCondition('Sufficient power left',
                               lambda pot: pot > 0.2, 'potential')
    clausul_1 = Clause('listen for the word',
                       [('sense', 'sound in surrounding'),
                        ('interpret', 'Was the word spoken?')],
                       condition=bc)

    clausul_2 = Clause('say something to the user',
                       [('mould', 'What response to give'),
                        ('act', 'loudspeaker vibrations')])
    clausul_3 = Clause('power check', condition=rc)
    clausul_4 = Clause('power warn',
                       [('mould', 'Select warn statement'),
                        ('act', 'loudspeaker vibrations')])

    plan = Plan('Clever stuff')
    plan.add_cargo('pronounce', 'listen for the word')
    plan.add_cargo('pronounce', 'say something to the user')
    plan.add_cargo('pronounce', 'power check')
    plan.add_cargo('pronounce', 'power warn')
    plan.add_dependency(2, 0, 3)
    plan.add_dependency(0, 1)
    plan.stamp_and_approve()

    agent = Agent('smart loudspeaker')
    agent.set_organs(s1, int1, moul1, moul2, a1)
    agent.set_messages(b1, belief_1, dir_1)
    agent.set_scaffold(battery)
    agent.set_policies(clausul_1, clausul_2, clausul_3, clausul_4, plan)

    agent.enact('Clever stuff')
    agent.enact('Clever stuff')
    agent.enact('Clever stuff')
    agent.enact('Clever stuff')
Beispiel #8
0
    def __init__(self, name, agents, lake):

        super().__init__(name, agents, common_env=lake)

        map_fish = ResourceMap('fish stock change', 'delta', 'n_fishes',
                               ('adjust_fish', ))
        map_potato = ResourceMap('potato stock change', 'delta', 'n_potatoes',
                                 ('adjust_potato', ))
        map_people = ResourceMap('birth death', 'delta', 'n_people',
                                 ('adjust_people', ))
        eat_love_death = MapCollection([map_fish, map_potato, map_people])

        natural_reqs = Compulsion('survival demands', self.eat_life_die,
                                  eat_love_death)
        self.set_law(natural_reqs)

        for agent in agents:
            more_fish = ResourceMap('add_fish', 'delta', 'n_fishes',
                                    ('add_fishes', ))
            fish_from_lake = Actuator('fish from lake', self.extract_from_lake,
                                      agent.direction['go fish like this'],
                                      more_fish)
            agent.set_organ(fish_from_lake)
    def __init__(self, name, diameter_init, energy_init, essence_value):

        super().__init__(name, strict_engine=True)

        belief = Belief('The diameter of the world', ('value', 'precision'))
        belief.set_values([diameter_init, 10.0])

        resource = Resource('Dietary energy', ('value',))
        essence = Essence('Persistence', ('value',))
        resource.set_values(energy_init)
        essence.set_values(essence_value)
        self.set_scaffolds(resource, essence)

        metabolism = ResourceMap('Dietary energy adjustment', 'delta', 'value', ('shift',))
        interpreter = Interpreter('Contemplate', self.contemplation, belief, belief,
                          metabolism)
        self.set_organ(interpreter)
def test_main():
    #
    # Define Messages
    #
    belief = Belief('Projectile status', ('speed', 'height', 'angle'))
    belief.set_values([100.0, 0.3, 0.2])
    direction = Direction('motion', ('horizontal direction',
                                     'horizontal magnitude',
                                     'vertical direction',
                                     'vertical magnitude'))

    #
    # Define Scaffold and Map for it
    #
    agent_resources = Resource('internal_resource', ('internal_energy',))
    agent_resources.set_values(20.0)
    change_energy = ResourceMap('adjust_energy', 'delta', 'internal_energy', ('expend_energy',))

    #
    # Define Organs and their associated messages
    #
    moulder = Moulder('take evasive action?', make_decision,
                      belief, direction,
                      change_energy)
    splitter_1 = MessageOperator(direction, slice_labels=['horizontal direction',
                                                          'horizontal magnitude'])
    splitter_2 = MessageOperator(direction, slice_labels=['vertical direction',
                                                          'vertical magnitude'])
    actuator1 = Actuator('move left right', move_rule_horizontal, splitter_1)
    actuator2 = Actuator('move up down', move_rule_vertical, splitter_2)

    #
    # Initialize Agent
    #
    agent = Agent('test_agent', strict_engine=True)
    agent.set_organ(moulder)
    agent.set_organ(actuator1)
    agent.set_organ(actuator2)
    agent.set_scaffold(agent_resources)
    agent.set_message(belief)

    #
    # Decide on direction and execute action
    #
    agent.mould('take evasive action?')
    agent.act('move up down')
    agent.act('move left right')
    assert (agent.resource['internal_energy'] == REF_E[0])
    belief.set_values([100.0, 1.3, -0.5])
    agent.mould('take evasive action?')
    agent.act('move up down')
    agent.act('move left right')
    assert (agent.resource['internal_energy'] == REF_E[1])
    for e1, e2 in zip(REPO, REF_REPO):
        assert(e1 == e2)

    try:
        agent.act('move up down')
        raise AssertionError('Action without preceding moulding did not raise exception')
    except EmptyFlashError:
        pass
    else:
        raise AssertionError('Action without preceding moulding did not raise expected exception')
    try:
        agent.act('move left right')
        raise AssertionError('Action without preceding moulding did not raise exception')
    except EmptyFlashError:
        pass
    else:
        raise AssertionError('Action without preceding moulding did not raise expected exception')
Beispiel #11
0
    def __init__(self, name, agents, full_agents_graph, midpoint_max_move,
                 max_max_move, mutate_prob, resource_jump_magnitude,
                 resource_jump_prob, mutate_essence):

        super().__init__(name,
                         agents,
                         full_agents_graph=full_agents_graph,
                         strict_engine=STRICT_ENGINE)

        self.midpoint_max_move = midpoint_max_move
        self.max_max_move = max_max_move

        for agent in agents:

            #
            # Sensor
            sensor = Sensor('Feel Neighbour Surface',
                            self._cmp_neighbour_coop,
                            agent.buzz['Neighbour Cooperator'],
                            agent_id_to_engine=True)
            agent.set_organ(sensor)

            #
            # Actuator
            a_a_subtract = ResourceMap('Consume A', 'delta', 'info_a',
                                       ('removal', ))
            a_b_subtract = ResourceMap('Consume B', 'delta', 'info_b',
                                       ('removal', ))
            a_c_subtract = ResourceMap('Consume C', 'delta', 'info_c',
                                       ('removal', ))
            consume_resources = MapCollection(
                [a_a_subtract, a_b_subtract, a_c_subtract])
            actuator = Actuator('Share Resources to Neighbours',
                                self._cmp_alter_env_resources,
                                agent.direction['Resources to Share'],
                                agent_id_to_engine=True,
                                resource_map_output=consume_resources)
            agent.set_organ(actuator)

            actuator = Actuator('Spread Lies to Neighbours',
                                self._cmp_spread_lies,
                                agent.direction['Lies to Eject'],
                                agent_id_to_engine=True,
                                resource_map_output=consume_resources)
            agent.set_organ(actuator)

            add_from_env = universal_map_maker(agent.resource, 'delta',
                                               ('add', ))
            actuator = Actuator('Gulp Environment',
                                self._cmp_gulp_env,
                                agent.direction['Fraction to Gulp'],
                                agent_id_to_engine=True,
                                resource_map_output=add_from_env)
            agent.set_organ(actuator)

            actuator = Actuator('Push Offspring Onto World',
                                self._cmp_offspring_onto_world,
                                agent.direction['Offspring'],
                                agent_id_to_engine=True)
            agent.set_organ(actuator)

        #
        # Mutation
        map_midpoint_share = EssenceMap('mutate_1', 'wiener', 'midpoint_share',
                                        ('range_step', ))
        map_midpoint_gulp = EssenceMap('mutate_2', 'wiener', 'midpoint_gulp',
                                       ('range_step', ))
        map_midpoint_tox = EssenceMap('mutate_3', 'wiener', 'midpoint_tox',
                                      ('range_step', ))
        map_max_share = EssenceMap('mutate_1b', 'wiener_bounded', 'max_share',
                                   ('range_step', 'lower', 'upper'))
        map_max_gulp = EssenceMap('mutate_2b', 'wiener_bounded', 'max_gulp',
                                  ('range_step', 'lower', 'upper'))
        map_max_tox = EssenceMap('mutate_3b', 'wiener_bounded', 'max_tox',
                                 ('range_step', 'lower', 'upper'))

        list_mid = []
        list_max = []
        if 'share' in mutate_essence:
            list_mid.append(map_midpoint_share)
            list_max.append(map_max_share)
        if 'gulp' in mutate_essence:
            list_mid.append(map_midpoint_gulp)
            list_max.append(map_max_gulp)
        if 'tox' in mutate_essence:
            list_mid.append(map_midpoint_tox)
            list_max.append(map_max_tox)

        if len(list_mid) > 0:
            mapper_midpoint = MapCollection(list_mid)
            mapper_max = MapCollection(list_max)
            mutate_midpoint = MultiMutation('Perturb Essence 1',
                                            self._midpoint_move,
                                            mapper_midpoint,
                                            mutation_prob=mutate_prob)
            mutate_max = MultiMutation('Perturb Essence 2',
                                       self._max_move,
                                       mapper_max,
                                       mutation_prob=mutate_prob)
            self.set_laws(mutate_midpoint, mutate_max)

        #
        # Random increase in internal resources
        self.resource_jump_magnitude = resource_jump_magnitude
        self.resource_jump_prob = resource_jump_prob
        a_jump = ResourceMap('Jump Increase A', 'delta', 'info_a', ('add', ))
        b_jump = ResourceMap('Jump Increase B', 'delta', 'info_b', ('add', ))
        c_jump = ResourceMap('Jump Increase C', 'delta', 'info_c', ('add', ))
        jump_resources = MapCollection([a_jump, b_jump, c_jump])
        resource_jump = Compulsion('Random Jump of Resources',
                                   self._cmp_resource_jump, jump_resources)
        self.set_law(resource_jump)
Beispiel #12
0
def test_main():
    #
    # Define Messages
    #
    buzz = Buzz('nerve_endings', ('first', 'second'))
    belief_1 = Belief('chance_of_rain', ('probability', ))
    belief_2 = Belief('ambiguity_kills_me', ('mood', ))
    direction = Direction('get_which_umbrella', ('any', 'colour'))

    #
    # Define Scaffold and Map for it
    #
    agent_resources = Resource('internal_resource', ('energy', ))
    agent_resources.set_values([100.0])
    change_energy = ResourceMap('adjust_energy', 'delta', 'energy',
                                ('how_much', ))

    #
    # Define Organs and their associated messages
    #
    interpreter_1 = Interpreter('will_it_rain',
                                rain_predictor,
                                buzz,
                                belief_1,
                                resource_map_output=change_energy)
    interpreter_2 = Interpreter('am_i_unlucky',
                                mood_maker,
                                belief_1,
                                belief_2,
                                resource_map_output=change_energy)
    total_belief = MessageOperator([belief_1, belief_2], extend=True)
    moulder = Moulder('fetch_umbrella_type', make_decision, total_belief,
                      direction, change_energy)

    #
    # Initialize Agent
    #
    agent = Agent('test_agent', strict_engine=True)
    agent._set('buzz', 'nerve_endings', buzz)
    agent.set_organ(moulder)
    agent.set_organ(interpreter_1)
    agent.set_organ(interpreter_2)
    agent.set_scaffold(agent_resources)

    #
    # Decide on direction and execute action
    #
    agent.buzz['nerve_endings'].set_values([0.2, 0.2])
    agent.interpret('will_it_rain')
    agent.interpret('am_i_unlucky')
    agent.mould('fetch_umbrella_type')
    assert (agent.direction['get_which_umbrella'].values() == REF[0])
    assert (agent.resource.values()[0] == pytest.approx(REF_RESOURCE[0]))

    agent.buzz['nerve_endings'].set_values([1.0, 0.6])
    agent.interpret('will_it_rain')
    agent.interpret('am_i_unlucky')
    agent.mould('fetch_umbrella_type')
    assert (agent.direction['get_which_umbrella'].values() == REF[1])
    assert (agent.resource.values()[0] == pytest.approx(REF_RESOURCE[1]))

    agent.buzz['nerve_endings'].set_values([1.0, 2.6])
    agent.interpret('will_it_rain')
    agent.interpret('am_i_unlucky')
    agent.mould('fetch_umbrella_type')
    assert (agent.direction['get_which_umbrella'].values() == REF[2])
    assert (agent.resource.values()[0] == pytest.approx(REF_RESOURCE[2]))
def test_main():
    #
    # Define Messages
    #
    belief = Belief('rich_environment',
                    ('stuff_1', 'stuff_2', 'stuff_3', 'stuff_4'))
    belief.set_values([0.7, 0.3, 0.6, 0.1])
    direction1 = Direction('grab_this_much', ('grab_volume', ))
    direction2 = Direction('shout_loud', ('volume', ))

    #
    # Define Scaffold and Map for it
    #
    agent_resources = Resource('internal_resource',
                               ('internal_energy', 'carrot', 'leek'))
    agent_resources.set_values([100.0, 4, 5])
    change_energy = ResourceMap('adjust_energy', 'delta', 'internal_energy',
                                ('expend_energy', ))
    change_carrot = ResourceMap('adjust_carrot', 'delta', 'carrot',
                                ('tweak_carrot', ))
    change_leek = ResourceMap('adjust_leek', 'delta', 'leek', ('tweak_leek', ))
    hoarding_food = MapCollection([change_carrot, change_leek])

    #
    # Define Organs and their associated messages
    #
    moulder1 = Moulder('reach_and_grab', make_decision, belief, direction1,
                       change_energy)
    moulder2 = Moulder('shout_how_much', shouter, belief, direction2)

    env = Env()
    actuator1 = Actuator('grab_it', env.grabber, direction1, hoarding_food)
    actuator2 = Actuator('shout', env.shout_into_void, direction2)

    #
    # Initialize Agent
    #
    agent = Agent('test_agent', strict_engine=True)
    agent.set_organ(moulder1)
    agent.set_organ(moulder2)
    agent.set_organ(actuator1)
    agent.set_organ(actuator2)
    agent.set_scaffold(agent_resources)

    #
    # Decide on direction and execute action
    #
    agent.mould('reach_and_grab')
    agent.act('grab_it')

    assert (agent.resource.values() == REF_RESOURCE_OUTCOME)

    agent.mould('shout_how_much')
    agent.act('shout')
    agent.mould('shout_how_much')
    agent.act('shout')

    assert (isclose(env.loud_cumsum, 3.4))

    try:
        agent.act('shout')
        raise AssertionError(
            'Action without preceding moulding did not raise exception')
    except EmptyFlashError:
        pass
    else:
        raise AssertionError(
            'Action without preceding moulding did not raise expected exception'
        )
Beispiel #14
0
def test_main():
    belief = Belief('dummy', ('a1', ))
    resource = Resource('internal energy', ('level', ))
    mapper = ResourceMap('eat energy', 'delta', 'level', ('shift', ))
    interpreter1 = Interpreter('thinker',
                               lambda x: (x + 1, -1),
                               belief,
                               belief,
                               resource_map_output=mapper)
    interpreter2 = Interpreter('thinker X',
                               lambda x: (x + 1, -3),
                               belief,
                               belief,
                               resource_map_output=mapper)
    battery = AutoResourceCondition('battery left', lambda x: x > 0)
    heart_1 = Heartbeat('big heart',
                        battery,
                        ticker_arithmetic=lambda: 2,
                        max_ticker=4)
    heart_2 = Heartbeat('small heart',
                        battery,
                        ticker_arithmetic=lambda: 1,
                        max_ticker=4)

    agent_1 = Agent('A1')
    agent_1.set_organs(interpreter1, interpreter2)
    belief.set_values([1])
    resource.set_values([10])
    agent_1.set_message(belief)
    agent_1.set_scaffold(resource)
    agent_1.set_policies(heart_1, heart_2)

    assert (agent_1.belief['dummy'].values()[0] == REF_B1[0])
    assert (agent_1.inert == REF_I1[0])
    agent_1.pump('big heart')
    agent_1.interpret('thinker')
    assert (agent_1.belief['dummy'].values()[0] == REF_B1[1])
    assert (agent_1.inert == REF_I1[1])
    agent_1.pump('big heart')
    agent_1.interpret('thinker')
    assert (agent_1.belief['dummy'].values()[0] == REF_B1[2])
    assert (agent_1.inert == REF_I1[2])
    agent_1.pump('big heart')
    agent_1.interpret('thinker')
    assert (agent_1.belief['dummy'].values()[0] == REF_B1[3])
    assert (agent_1.inert == REF_I1[3])

    agent_1.revive()
    assert (agent_1.inert == False)

    agent_1.pump('small heart')
    agent_1.interpret('thinker X')
    assert (agent_1.belief['dummy'].values()[0] == REF_B2[0])
    assert (agent_1.inert == REF_I2[0])
    agent_1.pump('small heart')
    agent_1.interpret('thinker X')
    assert (agent_1.belief['dummy'].values()[0] == REF_B2[1])
    assert (agent_1.inert == REF_I2[1])
    agent_1.pump('small heart')
    agent_1.interpret('thinker X')
    assert (agent_1.belief['dummy'].values()[0] == REF_B2[2])
    assert (agent_1.inert == REF_I2[2])
    agent_1.pump('small heart')
    agent_1.interpret('thinker X')
    assert (agent_1.belief['dummy'].values()[0] == REF_B2[3])
    assert (agent_1.inert == REF_I2[3])
    agent_1.pump('small heart')
    agent_1.interpret('thinker X')
    assert (agent_1.belief['dummy'].values()[0] == REF_B2[4])
    assert (agent_1.inert == REF_I2[4])