validAgentObject: Check the validity of an object of class Agent.

Description Usage Arguments Value See Also Examples

Description

The validAgenObject function checks whether an object of class Agent is a valid object. An object of the Agent-class is valid when:

(object@velocity)^2 ≤ 100.0

(in this case TRUE is returned), otherwise the message "The velocity is out of bounds." will appear.

Usage

1

Arguments

object

An object of class Agent.

Value

TRUE or an error message.

See Also

Agent, Agent-class, initialize,Agent-method

Examples

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)

mverouden/rsfour documentation built on May 25, 2019, 5:01 a.m.