Skip to contents

Works for agent-class.

Usage

color(object)

color(object) <- value

# S4 method for class 'agent'
color(object)

# S4 method for class 'agent'
color(object) <- value

Arguments

object

An instance of the agent-class.

value

Value with which to replace the original value of the color slot.

Examples

# Initialize agent
my_agent <- agent(center = c(0, 0), 
                  radius = 0.25, 
                  color = "black")

# Access the color slot for the agent
color(my_agent)
#>   mqnmk 
#> "black" 

# Change the color slot for the agent
color(my_agent) <- "blue"
color(my_agent)
#>  mqnmk 
#> "blue"