assign_agent_to_place()

Causes an agent to join a place.

Synopsis

assign_agent_to_place(place-id, agent-id)

Description

The agent with ID agent-id joins the place with place ID place-id.

If the agent already belongs to group of the given type, the agent first quits that group before joining the specified group. If the group already has maximum size, the action has no effect.

Parameters

place-id

An expression that evaluates to a valid place ID.

agent-id

An expression that evaluates to a valid oridinary agent ID.

Errors

A runtime error occurs if either argument does not evaluate to a valid ID.

Examples

A mother agent can enroll a child agent in her household as follows

new_agent_id = new_agent()
    assign_agent_to_place(Household, new_agent_id)

See Also

assign_agent_to_network(), join(), quit()