Works for agent-class.
Usage
goals(object)
goals(object) <- value
# S4 method for class 'agent'
goals(object)
# S4 method for class 'agent'
goals(object) <- valueArguments
- object
An instance of the
agent-class.- value
Value with which to replace the original value of the
goalsslot.
Examples
# Initialize agent
my_agent <- agent(center = c(0, 0),
radius = 0.25,
goals = list(goal(position = c(1, 0))))
# Access the goals slot for the agent
goals(my_agent)
#> [[1]]
#> Goal Attributes
#> busy: FALSE
#> counter: 5
#> done: FALSE
#> id: goal zfloa
#> path:
#> [,1] [,2]
#>
#> position: 1 0
#>
#> For more detailed information, please extract the wanted information from the background directly.
#>
# Change the goals slot for the agent
goals(my_agent) <- list(goal(position = c(-1, 0)))
goals(my_agent)
#> [[1]]
#> Goal Attributes
#> busy: FALSE
#> counter: 5
#> done: FALSE
#> id: goal ffkrl
#> path:
#> [,1] [,2]
#>
#> position: -1 0
#>
#> For more detailed information, please extract the wanted information from the background directly.
#>