Title: | Advanced Policing Techniques for the Board Game "Letters from Whitechapel" |
---|---|
Description: | Provides a set of functions to make tracking the hidden movements of the 'Jack' player easier. By tracking every possible path Jack might have traveled from the point of the initial murder including special movement such as through alleyways and via carriages, the police can more accurately narrow the field of their search. Additionally, by tracking all possible hideouts from round to round, rounds 3 and 4 should have a vastly reduced field of search. |
Authors: | Mark Ewing [aut, cre] |
Maintainer: | Mark Ewing <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.0 |
Built: | 2025-02-02 03:10:16 UTC |
Source: | https://github.com/bmewing/whitechapelr |
Data used to establish possible connections used by Jack between nodes via alleyways
alley
alley
A data frame with 452 rows and 2 variables
The smaller integer of the pair of vertices
The larger integer of the pair of vertices
Create or update a list of possible hideouts based on final positions from the list of possible paths traveled.
end_round(paths, hideouts = NULL)
end_round(paths, hideouts = NULL)
paths |
list of all possible paths already traveled |
hideouts |
optional vector of possible hideouts from previous rounds. Not used in round 1, only rounds 2 and 3 |
list of all possible hideouts
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 = inspect_space(possibilities,space = c(29,30), clue = FALSE) possibilities = inspect_space(possibilities,space = 49, clue = TRUE) hideouts = end_round(possibilities,hideouts=NULL) possibilities = start_round(67) possibilities = take_a_step(possibilities,roads) hideouts = end_round(possibilities,hideouts=hideouts)
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 = inspect_space(possibilities,space = c(29,30), clue = FALSE) possibilities = inspect_space(possibilities,space = 49, clue = TRUE) hideouts = end_round(possibilities,hideouts=NULL) possibilities = start_round(67) possibilities = take_a_step(possibilities,roads) hideouts = end_round(possibilities,hideouts=hideouts)
Updated the list of possible paths based on the results of police investigation
inspect_space(paths, space, clue)
inspect_space(paths, space, clue)
paths |
list of all possible paths already traveled |
space |
vector of integers of the spaces inspected |
clue |
single logical value indicating if evidence of Jack was found |
list of all possible paths traveled by Jack
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 = inspect_space(possibilities,space = c(29,30), clue = FALSE) possibilities = inspect_space(possibilities,space = 49, clue = TRUE)
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 = inspect_space(possibilities,space = c(29,30), clue = FALSE) possibilities = inspect_space(possibilities,space = 49, clue = TRUE)
Data used to place nodes in graphical output according to their relative positions on the game board
node_locations
node_locations
A data frame with 195 rows and 4 variables
An artifact of the computer vision process used to obtain coordinates
The number of pixels from the left edge of the board to the center of the node
The number of pixels from the top edge of the board to the center of the node
The integer assigned to the node on the game board
Data used to establish possible connections used by Jack between nodes
roads
roads
A data frame with 767 rows and 2 variables
The smaller integer of the pair of vertices
The larger integer of the pair of vertices
Show a graph representation of the game board with nodes placed in the appropriate relative spot, colored by the number of paths which include a particular node. Possible hideouts are marked with blue squares.
show_board(paths = NULL, hideouts = NULL, roads, alley, node_locations)
show_board(paths = NULL, hideouts = NULL, roads, alley, node_locations)
paths |
optional list of all possible paths already traveled |
hideouts |
optional vector of possible hideouts from previous rounds. |
roads |
data.frame of non-directional edge pairs for the road graph |
alley |
data.frame of non-directional edge pairs for the alley graph |
node_locations |
data.frame of where nodes should be placed in the graph |
roads, alley and node_locations are all bundled with the package (e.g. data(roads)
).
Solid lines in the graph represent road connections between nodes. Dashed lines represent alley way connections.
plotted igraph object
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) show_board(paths=possibilities,hideouts=NULL,roads,alley,node_locations)
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) show_board(paths=possibilities,hideouts=NULL,roads,alley,node_locations)
Generate the initial list for a new round
start_round(initial_murder)
start_round(initial_murder)
initial_murder |
integer Space of the initial murder(s) |
list with the initial murder location(s) as the starting point(s)
possibilities = start_round(64) possibilities = start_round(128)
possibilities = start_round(64) possibilities = start_round(128)
Track two steps of unknown movement by Jack, on roads
take_a_carriage(paths)
take_a_carriage(paths)
paths |
list of all possible paths already traveled |
list of all possible paths traveled by Jack
possibilities = start_round(64) possibilities = take_a_carriage(possibilities)
possibilities = start_round(64) possibilities = take_a_carriage(possibilities)
Track one step of unknown movement by Jack, either on roads or through alleyways
take_a_step(paths, roads, blocked = NULL)
take_a_step(paths, roads, blocked = NULL)
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) |
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.
list of all possible paths traveled by Jack
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)
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)
Remove known impossible end points for Jack, typically as a result of having found, but not arrested Jack.
trim_possibilities(paths, node)
trim_possibilities(paths, node)
paths |
list of all possible paths already traveled |
node |
vector of length 1 or 2 which specifies blocked nodes due to the presence of a policeman |
list of trimmed possible paths traveled by Jack
possibilities = start_round(64) possibilities = take_a_carriage(possibilities) possibilities = trim_possibilities(possibilities,82) possibilities = trim_possibilities(possibilities,c(66,67))
possibilities = start_round(64) possibilities = take_a_carriage(possibilities) possibilities = trim_possibilities(possibilities,82) possibilities = trim_possibilities(possibilities,c(66,67))