Learn R Programming

whitechapelR (version 0.3.0)

take_a_step: Track one movement

Description

Track one step of unknown movement by Jack, either on roads or through alleyways

Usage

take_a_step(paths, roads, blocked = NULL)

Arguments

paths

list of all possible paths already traveled

roads

data.frame of non-directional edge pairs for either the road graph or the alley graph

blocked

list of node pairs which cannot be traversed because a police officer blocks it (should not be used for special movement)

Value

list of all possible paths traveled by Jack

Details

The non-directional edge pairs are available via data(roads) or data(alley) This function does not account for the rule that Jack cannot travel through a road occupied by a police officer.

Examples

Run this code
# NOT RUN {
possibilities = start_round(64)
possibilities = take_a_step(possibilities,roads)
possibilities = take_a_step(possibilities,roads,blocked=list(c(63,82),c(63,65)))
possibilities = take_a_step(possibilities,alley)
# }

Run the code above in your browser using DataLab