Description Usage Arguments See Also Examples
The initialize function sets the values for the slots of an object of class Agent.
1 2 3 | ## S4 method for signature 'Agent'
initialize(.Object, location = numeric(0),
velocity = numeric(0), active = logical(0))
|
.Object |
An object of class Agent. |
location |
A numerical vector of length 2 specifying the x- and y-position of the object of class Agent [Default: c(0, 0)]. |
velocity |
A numerical vector of length 2 specifying the velocity in the x- and y-direction of the object of class Agent [Default: c(0, 0)]. |
active |
A length-one logical vector indicating whether the object of class Agent is active (TRUE) or not (FALSE) [Default: TRUE]. |
Agent, Agent-class
,
validAgentObject
1 2 3 4 5 6 7 8 | a <- new("Agent")
print(a)
a <- initialize(a,
location = c(1.23, 10.5),
velocity = c(5 * sqrt(2), 5 * sqrt(2)),
active = FALSE)
validAgentObject(a)
print(a)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.