Skip to main content

Place At

Icon

PlaceAt_image1.png

Function

The Place At component places a target agent at a specified location within a Cell space.

Key Points

  • How It Works
    • Regardless of the Agent's current location, it will be directly set to the specified position. There are two methods to specify the position:
      • Specify an individual object within the target Agent or Cell populations.
      • Specify the Cell space and coordinates.
    • When the specific target entity is an agent, the placed agent's property Angle will adjust to match the target's property Angle. When the specific target entity is a cell, the placed agent's property Angle will be set to 0.
  • The Place At component has no data output.
Tips: The Differences between Place At and Move
  • The Place At component signifies that the Agent's position is instantly set, regardless of its original space state.
  • The Move component indicates that the Agent moves to a specific location, which is a physical process. The Agent's next position can be determined based on its original position and Move parameter settings.
  • You cannot directly use a calculation formula to modify the Agent's built-in properties, CurrentSpace and Coordinate, or the property Angle for instantaneous movements.
  • The Place At component is frequently used to initialize the Agent's location dynamically. The action's executing entity can be the Agent itself or another entity. The Move component is used for physical movement from the agent's perspective, and its action can only be executed by the Agent itself.

How to Set Up

PlaceAt_image2.png

Specify the Target

  • Expression Input Box
    • This input box accepts expressions that can return an Agent or [Agent].
    • The system will place all Agent individuals in the same specified location.
Examples: Expressions for Specifying the Target
  • wolf.Individuals: All individuals of the wolf population.
  • sheep.FilterEntities(self.GetNeighbors(1.5)): All sheep within a radius of 1.5 with oneself as the center.
  • GetRelatives(cooperation,1): People who have a direct (radius 1) cooperative relationship (named cooperation Link object) with themselves (here, you can omit the self keyword).

This is similar to specifying the entity objects in the Ask component.

Specify the Position

Select the methods: specifying the position of an existing entity or specific coordinates.

To an Existing Entity

PlaceAt_image3.png

Enter an expression in the input box below that returns an Agent or Cell individual.

To Specific Coordinates

PlaceAt_image4.png

  • First Input Box: Specifies coordinates and accepts any expression that returns data formatted as [Number, Number].
  • Second Input Box: Specifies the space and accepts any expression that returns a Cell object.
  • Please Note:
    • When the Cell space does not wrap around, the specified longitudinal and lateral coordinates cannot exceed the space boundary. Otherwise, an error will be reported, as shown in the figure below.

      PlaceAt_image5.png

    • When the Cell space wraps around, the specified coordinates can exceed the boundary, and the system will automatically calculate to run normally within the boundary.
Tip

HoloBit currently only supports 2D Cell space. Hence, the coordinates are represented as a list with two Number elements, each corresponding to the x and y coordinates, respectively.

Example

Model Example

Move a sheep from its initial position [0, 0] to [5, 5] at the 3rd Tick. You can run the simulation step by step to see what happens.