emptyHood: Function to check if the there is a free place in the Moore...

Description Usage Arguments Value See Also Examples

Description

The generic function emptyHood gives a free space which is present in the Moore neighbourhood of an individual of interest.

Usage

1
2
3
4
emptyHood(object, pos, n, m, x, y, occupyM, inverse = FALSE)

## S4 method for signature 'Organism'
emptyHood(object, pos, n, m, x, y, occupyM, inverse = FALSE)

Arguments

object

An object of class Organisms.

pos

A dataframe with all occupied x and y positions

n

A number giving the horizontal size of the environment.

m

A number giving the vertical size of the environment.

x

A number giving the x position of the individual of interest in its environment.

y

A number giving the y position of the individual of interest in its environment.

occupyM

A matrix indicating grid cells that are obstacles

inverse

Return occupied positions instead

Value

Returns the free position in the Moore neighbourhood, which is not occupied by other individuals. If there is no free space NULL is returned.

See Also

Organism-class

Examples

1

BacArena documentation built on July 2, 2020, 3:16 a.m.