Description Format Construction Fields Methods
An Asset represents physical objects such as buildings and vehicles that can be owned/rent/belong by or to agents of the Agent sub classes. For example, Household agents own or rent residential buildings.
R6::R6Class object inheriting from Entity.
1 |
Stores .data
as a DataBackend object inside the object's list of data (private$.data
)
and registers the id_col
(private$.id_col
).
.data
:: data.frame
A object that inherits from data.frame
.
id_col
:: character(1)
The id column of .data
.
owner
:: an R6::R6Class object that inherits Agent.
NULL
is_owned(ids)
(integer()
) -> (logical()
)
Check if the assets in ids
are owned. If ids
is not given the result will
be for all assets.
get_owner(ids)
(integer()
) -> (integer()
)
Get the owner ids of the assets in ids
.
set_owner(ids, owner_ids)
(integer()
|integer()
)
Set the owners in owner_ids
to the assets in ids
. Both arguments must
have an equal length. An asset can only be owned by one owner.
get_owner_id_col()
() -> character(1)
.
Returns the id column of the owner object.
get_owner_object()
() -> an R6::R6Class object that inherits Agent.
Returns the owner object of this asset.
set_owner_object(x)
(an R6::R6Class that inherits Agent)
Set owner. This assigns the owner object to the Owner
field of this
asset hence you can access the owner object using x$Owner
(assuming that
the asset object was named x
).
remove_owner(ids)
(integer()
)
Remove the owner ids from the assets in ids
by setting them to NA
.
owner_gets_asset_id(owner_ids)
(integer()
) -> (integer()
Get the asset ids of the owners in owner_ids
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.