Title: | Elithorn Maze Generator |
---|---|
Description: | A maze generator that creates the Elithorn Maze (HTML file) and the functions to calculate the associated maze parameters (i.e. Difficulty and Ability). |
Authors: | Bao Sheng Loe (Aiden) [aut,cre,cph], Maria Sanchez[ctb] |
Maintainer: | Bao Sheng Loe (Aiden) <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2025-02-03 02:53:19 UTC |
Source: | https://github.com/aidenloe/mazegen |
This generate the solution by searching for the SEED that returns the specific number of paths to achieve the maximum score for a given rank and saturation.
genEMLseed(path = 3, rank = 5, satPercent = 0.5, seed = 1, runSeed = 500)
genEMLseed(path = 3, rank = 5, satPercent = 0.5, seed = 1, runSeed = 500)
path |
Selecting the specific number of paths to achieve the maximum score. |
rank |
This is the rank of the maze. |
satPercent |
This is of saturation percentage ranging from 0-1. |
seed |
The starting seed to begin searching for the seed with specific paths. |
runSeed |
This determines the number of searches for the specific paths before stopping. |
This might be computationally intensive as the maze size increases. The seed is necessary so that the algorithm does not always begin from the smallest seed value. Based on the starting seed value, it will search for the next seed that returns the desired number of path defined by the user. To limit the search time, The function will stop looking for the seed based on the runSeed value. Using this function will guarantee that the minimum number of steps to achieve the maximum score will be the same for all possible paths. If the number of steps does not need to be equal across all possible paths for the maximum score, please use the genPathSeed
function instead.
Aiden Loe and Maria Sanchez
rank <- 5 satPercent <- 0.5 seed <- 1 #Search for just one unique path justOne <- genEMLseed(path=1,rank=rank,satPercent=satPercent,seed=seed) nodePosition <- np(rank,satPercent,seed=justOne) mazeEst(nodePosition) #Search for three path justThree <- genEMLseed(path=3,rank=rank,satPercent=satPercent,seed=seed, runSeed=300) nodePosition <- np(rank,satPercent,seed=justThree) mazeEst(nodePosition)
rank <- 5 satPercent <- 0.5 seed <- 1 #Search for just one unique path justOne <- genEMLseed(path=1,rank=rank,satPercent=satPercent,seed=seed) nodePosition <- np(rank,satPercent,seed=justOne) mazeEst(nodePosition) #Search for three path justThree <- genEMLseed(path=3,rank=rank,satPercent=satPercent,seed=seed, runSeed=300) nodePosition <- np(rank,satPercent,seed=justThree) mazeEst(nodePosition)
This function generates the list of edges.
genMaze(rank = 5)
genMaze(rank = 5)
rank |
This is the Rank of the maze. |
The Genmaze function generates the list of edges. The edges will be used to construct the maze.
Aiden Loe
genMaze(rank=5)
genMaze(rank=5)
This generate the solution by searching for the SEED that returns the specific number of paths to achieve the maximum score for a given rank and saturation.
genPathSeed(path = 3, rank = 5, satPercent = 0.5, seed = 1, runSeed = 500)
genPathSeed(path = 3, rank = 5, satPercent = 0.5, seed = 1, runSeed = 500)
path |
Selecting the specific number of paths to achieve the maximum score. |
rank |
This is the rank of the maze. |
satPercent |
This is of saturation percentage ranging from 0-1. |
seed |
The starting seed to begin searching for the seed with specific paths. |
runSeed |
This determines the number of searches for the specific paths before stopping. |
This might be computationally intensive as the maze size increases. The seed is necessary so that the algorithm does not always begin from the smallest seed value. Based on the starting seed value, it will search for the next seed that returns the desired number of path defined by the user. To limit the search time, The function will stop looking for the seed based on the runSeed value. Using this function does not guarantee that the minimum number of steps will be the same for all possible paths to achieve the maximum score. To ensure that the number of steps are equal across all possible paths for the maximum score, please use the genEMLseed
function instead.
Aiden Loe and Maria Sanchez
rank <- 5 satPercent <- 0.5 seed <- 1 #Search for just one unique path justOne <- genPathSeed(path=1,rank=rank,satPercent=satPercent,seed=seed) nodePosition <- np(rank,satPercent,seed=justOne) mazeEst(nodePosition) #Search for three path justThree <- genPathSeed(path=3,rank=rank,satPercent=satPercent,seed=seed, runSeed=300) nodePosition <- np(rank,satPercent,seed=justThree) mazeEst(nodePosition)
rank <- 5 satPercent <- 0.5 seed <- 1 #Search for just one unique path justOne <- genPathSeed(path=1,rank=rank,satPercent=satPercent,seed=seed) nodePosition <- np(rank,satPercent,seed=justOne) mazeEst(nodePosition) #Search for three path justThree <- genPathSeed(path=3,rank=rank,satPercent=satPercent,seed=seed, runSeed=300) nodePosition <- np(rank,satPercent,seed=justThree) mazeEst(nodePosition)
This returns a eight grid downwards maze. These are standardized coordinates.
data(gridEightDown)
data(gridEightDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 8 data(gridEightDown) coordinates <- gridEightDown ## End(Not run)
## Not run: # Returns a Grid with rank = 8 data(gridEightDown) coordinates <- gridEightDown ## End(Not run)
This returns a eighteen grid downards maze. These are standardized coordinates.
data(gridEighteenDown)
data(gridEighteenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 18 data(gridEighteenDown) coordinates <- gridEighteenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 18 data(gridEighteenDown) coordinates <- gridEighteenDown ## End(Not run)
This returns a eighteen grid left maze. These are standardized coordinates.
data(gridEighteenLeft)
data(gridEighteenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 18 data(gridEighteenLeft) coordinates <- gridEighteenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 18 data(gridEighteenLeft) coordinates <- gridEighteenLeft ## End(Not run)
This returns a eighteen grid right maze. These are standardized coordinates.
data(gridEighteenRight)
data(gridEighteenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 18 data(gridEighteenRight) coordinates <- gridEighteenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 18 data(gridEighteenRight) coordinates <- gridEighteenRight ## End(Not run)
This returns a eighteen grid upwards maze. These are standardized coordinates.
data(gridEighteenUp)
data(gridEighteenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 18 data(gridEightteenUp) coordinates <- gridEighteenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 18 data(gridEightteenUp) coordinates <- gridEighteenUp ## End(Not run)
This returns a eight grid left maze. These are standardized coordinates.
data(gridEightLeft)
data(gridEightLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 8 data(gridEightLeft) coordinates <- gridEightLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 8 data(gridEightLeft) coordinates <- gridEightLeft ## End(Not run)
This returns a eight grid right maze. These are standardized coordinates.
data(gridEightRight)
data(gridEightRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 8 data(gridEightRight) coordinates <- gridEightRight ## End(Not run)
## Not run: # Returns a Grid with rank = 8 data(gridEightRight) coordinates <- gridEightRight ## End(Not run)
This returns a eight grid upwards maze. These are standardized coordinates.
data(gridEightUp)
data(gridEightUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 8 data(gridEightUp) coordinates <- gridEightUp ## End(Not run)
## Not run: # Returns a Grid with rank = 8 data(gridEightUp) coordinates <- gridEightUp ## End(Not run)
This returns a eleven grid downards maze. These are standardized coordinates.
data(gridElevenDown)
data(gridElevenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 11 data(gridElevenDown) coordinates <- gridElevenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 11 data(gridElevenDown) coordinates <- gridElevenDown ## End(Not run)
This returns a eleven grid left maze. These are standardized coordinates.
data(gridElevenLeft)
data(gridElevenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 11 data(gridElevenLeft) coordinates <- gridElevenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 11 data(gridElevenLeft) coordinates <- gridElevenLeft ## End(Not run)
This returns a eleven grid right maze. These are standardized coordinates.
data(gridElevenRight)
data(gridElevenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 11 data(gridElevenRight) coordinates <- gridElevenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 11 data(gridElevenRight) coordinates <- gridElevenRight ## End(Not run)
This returns a eleven grid upwards maze. These are standardized coordinates.
data(gridElevenUp)
data(gridElevenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 11 data(gridElevenUp) coordinates <- gridElevenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 11 data(gridElevenUp) coordinates <- gridElevenUp ## End(Not run)
This returns a fifteen grid downards maze. These are standardized coordinates.
data(gridFifteenDown)
data(gridFifteenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 15 data(gridFifteenDown) coordinates <- gridFifteenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 15 data(gridFifteenDown) coordinates <- gridFifteenDown ## End(Not run)
This returns a fifteen grid left maze. These are standardized coordinates.
data(gridFifteenLeft)
data(gridFifteenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 15 data(gridFifteenLeft) coordinates <- gridFifteenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 15 data(gridFifteenLeft) coordinates <- gridFifteenLeft ## End(Not run)
This returns a fifteen grid right maze. These are standardized coordinates.
data(gridFifteenRight)
data(gridFifteenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 15 data(gridFifteenRight) coordinates <- gridFifteenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 15 data(gridFifteenRight) coordinates <- gridFifteenRight ## End(Not run)
This returns a fifteen grid upwards maze. These are standardized coordinates.
data(gridFifteenUp)
data(gridFifteenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 15 data(gridFifteenUp) coordinates <- gridFifteenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 15 data(gridFifteenUp) coordinates <- gridFifteenUp ## End(Not run)
This returns a five grid downwards maze. These are standardized coordinates.
data(gridFiveDown)
data(gridFiveDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 5 data(gridFiveDown) coordinates <- gridFiveDown ## End(Not run)
## Not run: # Returns a Grid with rank = 5 data(gridFiveDown) coordinates <- gridFiveDown ## End(Not run)
This returns a five grid left maze. These are standardized coordinates.
data(gridFiveLeft)
data(gridFiveLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 5 data(gridFiveLeft) coordinates <- gridFiveLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 5 data(gridFiveLeft) coordinates <- gridFiveLeft ## End(Not run)
This returns a five grid right maze. These are standardized coordinates.
data(gridFiveRight)
data(gridFiveRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 5 data(gridFiveRight) coordinates <- gridFiveRight ## End(Not run)
## Not run: # Returns a Grid with rank = 5 data(gridFiveRight) coordinates <- gridFiveRight ## End(Not run)
This returns a five grid upwards maze. These are standardized coordinates.
data(gridFiveUp)
data(gridFiveUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 5 data(gridFiveUp) coordinates <- gridFiveUp ## End(Not run)
## Not run: # Returns a Grid with rank = 5 data(gridFiveUp) coordinates <- gridFiveUp ## End(Not run)
This returns a four grid downwards maze. These are standardized coordinates.
data(gridFourDown)
data(gridFourDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 4 data(gridFourDown) coordinates <- gridFourDown ## End(Not run)
## Not run: # Returns a Grid with rank = 4 data(gridFourDown) coordinates <- gridFourDown ## End(Not run)
This returns a four grid left maze. These are standardized coordinates.
data(gridFourLeft)
data(gridFourLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 4 data(gridFourLeft) coordinates <- gridFourLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 4 data(gridFourLeft) coordinates <- gridFourLeft ## End(Not run)
This returns a four grid right maze. These are standardized coordinates.
data(gridFourRight)
data(gridFourRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 4 data(gridFourRight) coordinates <- gridFourRight ## End(Not run)
## Not run: # Returns a Grid with rank = 4 data(gridFourRight) coordinates <- gridFourRight ## End(Not run)
This returns a fourteen grid downards maze. These are standardized coordinates.
data(gridFourteenDown)
data(gridFourteenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 14 data(gridFourteenDown) coordinates <- gridFourteenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 14 data(gridFourteenDown) coordinates <- gridFourteenDown ## End(Not run)
This returns a fourteen grid left maze. These are standardized coordinates.
data(gridFourteenLeft)
data(gridFourteenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 14 data(gridFourteenLeft) coordinates <- gridFourteenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 14 data(gridFourteenLeft) coordinates <- gridFourteenLeft ## End(Not run)
This returns a fourteen grid right maze. These are standardized coordinates.
data(gridFourteenRight)
data(gridFourteenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 14 data(gridFourteenRight) coordinates <- gridFourteenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 14 data(gridFourteenRight) coordinates <- gridFourteenRight ## End(Not run)
This returns a fourteen grid upwards maze. These are standardized coordinates.
data(gridFourteenUp)
data(gridFourteenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 14 data(gridFourteenUp) coordinates <- gridFourteenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 14 data(gridFourteenUp) coordinates <- gridFourteenUp ## End(Not run)
This returns a four grid upwards maze. These are standardized coordinates.
data(gridFourUp)
data(gridFourUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 4 data(gridFourUp) coordinates <- gridFourUp ## End(Not run)
## Not run: # Returns a Grid with rank = 4 data(gridFourUp) coordinates <- gridFourUp ## End(Not run)
This returns a nine grid downwards maze. These are standardized coordinates.
data(gridNineDown)
data(gridNineDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 9 data(gridNineDown) coordinates <- gridNineDown ## End(Not run)
## Not run: # Returns a Grid with rank = 9 data(gridNineDown) coordinates <- gridNineDown ## End(Not run)
This returns a nine grid left maze. These are standardized coordinates.
data(gridNineLeft)
data(gridNineLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 9 data(gridNineLeft) coordinates <- gridNineLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 9 data(gridNineLeft) coordinates <- gridNineLeft ## End(Not run)
This returns a nine grid right maze. These are standardized coordinates.
data(gridNineRight)
data(gridNineRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 9 data(gridNineRight) coordinates <- gridNineRight ## End(Not run)
## Not run: # Returns a Grid with rank = 9 data(gridNineRight) coordinates <- gridNineRight ## End(Not run)
This returns a nineteen grid right maze. These are standardized coordinates.
This returns a nineteen grid right maze. These are standardized coordinates.
This returns a nineteen grid right maze. These are standardized coordinates.
This returns a nineteen grid right maze. These are standardized coordinates.
data(gridNineteenUp) data(gridNineteenDown) data(gridNineteenLeft) data(gridNineteenRight)
data(gridNineteenUp) data(gridNineteenDown) data(gridNineteenLeft) data(gridNineteenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 19 data(gridNineteenUp) coordinates <- gridNineteenUp ## End(Not run) ## Not run: # Returns a Grid with rank = 19 data(gridNineteenDown) coordinates <- gridNineteenDown ## End(Not run) ## Not run: # Returns a Grid with rank = 19 data(gridNineteenLeft) coordinates <- gridNineteenLeft ## End(Not run) ## Not run: # Returns a Grid with rank = 19 data(gridNineteenRight) coordinates <- gridNineteenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 19 data(gridNineteenUp) coordinates <- gridNineteenUp ## End(Not run) ## Not run: # Returns a Grid with rank = 19 data(gridNineteenDown) coordinates <- gridNineteenDown ## End(Not run) ## Not run: # Returns a Grid with rank = 19 data(gridNineteenLeft) coordinates <- gridNineteenLeft ## End(Not run) ## Not run: # Returns a Grid with rank = 19 data(gridNineteenRight) coordinates <- gridNineteenRight ## End(Not run)
This returns a nine grid upwards maze. These are standardized coordinates.
data(gridNineUp)
data(gridNineUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 9 data(gridNineUp) coordinates <- gridNineUp ## End(Not run)
## Not run: # Returns a Grid with rank = 9 data(gridNineUp) coordinates <- gridNineUp ## End(Not run)
This returns a seven grid downwards maze. These are standardized coordinates.
data(gridSevenDown)
data(gridSevenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 7 data(gridSevenDown) coordinates <- gridSevenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 7 data(gridSevenDown) coordinates <- gridSevenDown ## End(Not run)
This returns a seven grid left maze. These are standardized coordinates.
data(gridSevenLeft)
data(gridSevenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 7 data(gridSevenLeft) coordinates <- gridSevenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 7 data(gridSevenLeft) coordinates <- gridSevenLeft ## End(Not run)
This returns a seven grid right maze. These are standardized coordinates.
data(gridSevenRight)
data(gridSevenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 7 data(gridSevenRight) coordinates <- gridSevenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 7 data(gridSevenRight) coordinates <- gridSevenRight ## End(Not run)
This returns a seventeen grid downards maze. These are standardized coordinates.
data(gridSeventeenDown)
data(gridSeventeenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenDown) coordinates <- gridSeventeenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenDown) coordinates <- gridSeventeenDown ## End(Not run)
This returns a seventeen grid left maze. These are standardized coordinates.
data(gridSeventeenLeft)
data(gridSeventeenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenLeft) coordinates <- gridSeventeenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenLeft) coordinates <- gridSeventeenLeft ## End(Not run)
This returns a seventeen grid right maze. These are standardized coordinates.
data(gridSeventeenRight)
data(gridSeventeenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenRight) coordinates <- gridSeventeenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenRight) coordinates <- gridSeventeenRight ## End(Not run)
This returns a seventeen grid upwards maze. These are standardized coordinates.
data(gridSeventeenUp)
data(gridSeventeenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenUp) coordinates <- gridSeventeenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 17 data(gridSeventeenUp) coordinates <- gridSeventeenUp ## End(Not run)
This returns a seven grid upwards maze. These are standardized coordinates.
data(gridSevenUp)
data(gridSevenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 7 data(gridSevenUp) coordinates <- gridSevenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 7 data(gridSevenUp) coordinates <- gridSevenUp ## End(Not run)
This returns a six grid downwards maze. These are standardized coordinates.
data(gridSixDown)
data(gridSixDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 6 data(gridSixDown) coordinates <- gridSixDown ## End(Not run)
## Not run: # Returns a Grid with rank = 6 data(gridSixDown) coordinates <- gridSixDown ## End(Not run)
This returns a six grid left maze. These are standardized coordinates.
data(gridSixLeft)
data(gridSixLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 6 data(gridSixLeft) coordinates <- gridSixLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 6 data(gridSixLeft) coordinates <- gridSixLeft ## End(Not run)
This returns a six grid right maze. These are standardized coordinates.
data(gridSixRight)
data(gridSixRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 6 data(gridSixRight) coordinates <- gridSixRight ## End(Not run)
## Not run: # Returns a Grid with rank = 6 data(gridSixRight) coordinates <- gridSixRight ## End(Not run)
This returns a sixteen grid downards maze. These are standardized coordinates.
data(gridSixteenDown)
data(gridSixteenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 16 data(gridSixteenDown) coordinates <- gridSixteenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 16 data(gridSixteenDown) coordinates <- gridSixteenDown ## End(Not run)
This returns a sixteen grid left maze. These are standardized coordinates.
data(gridSixteenLeft)
data(gridSixteenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 16 data(gridSixteenLeft) coordinates <- gridSixteenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 16 data(gridSixteenLeft) coordinates <- gridSixteenLeft ## End(Not run)
This returns a sixteen grid right maze. These are standardized coordinates.
data(gridSixteenRight)
data(gridSixteenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 16 data(gridSixteenRight) coordinates <- gridSixteenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 16 data(gridSixteenRight) coordinates <- gridSixteenRight ## End(Not run)
This returns a sixteen grid upwards maze. These are standardized coordinates.
data(gridSixteenUp)
data(gridSixteenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 16 data(gridSixteenUp) coordinates <- gridSixteenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 16 data(gridSixteenUp) coordinates <- gridSixteenUp ## End(Not run)
This returns a six grid upwards maze. These are standardized coordinates.
data(gridSixUp)
data(gridSixUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 6 data(gridSixUp) coordinates <- gridSixUp ## End(Not run)
## Not run: # Returns a Grid with rank = 6 data(gridSixUp) coordinates <- gridSixUp ## End(Not run)
This returns a ten grid downards maze. These are standardized coordinates.
data(gridTenDown)
data(gridTenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 10 data(gridTenDown) coordinates <- gridTenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 10 data(gridTenDown) coordinates <- gridTenDown ## End(Not run)
This returns a ten grid left maze. These are standardized coordinates.
data(gridTenLeft)
data(gridTenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 10 data(gridTenLeft) coordinates <- gridTenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 10 data(gridTenLeft) coordinates <- gridTenLeft ## End(Not run)
This returns a ten grid right maze. These are standardized coordinates.
data(gridTenRight)
data(gridTenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 10 data(gridTenRight) coordinates <- gridTenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 10 data(gridTenRight) coordinates <- gridTenRight ## End(Not run)
This returns a ten grid upwards maze. These are standardized coordinates.
data(gridTenUp)
data(gridTenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 10 data(gridTenUp) coordinates <- gridTenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 10 data(gridTenUp) coordinates <- gridTenUp ## End(Not run)
This returns a thirteen grid downards maze. These are standardized coordinates.
data(gridThirteenDown)
data(gridThirteenDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 13 data(gridThirteenDown) coordinates <- gridThirteenDown ## End(Not run)
## Not run: # Returns a Grid with rank = 13 data(gridThirteenDown) coordinates <- gridThirteenDown ## End(Not run)
This returns a thirteen grid left maze. These are standardized coordinates.
data(gridThirteenLeft)
data(gridThirteenLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 13 data(gridThirteenLeft) coordinates <- gridThirteenLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 13 data(gridThirteenLeft) coordinates <- gridThirteenLeft ## End(Not run)
This returns a thirteen grid right maze. These are standardized coordinates.
data(gridThirteenRight)
data(gridThirteenRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 13 data(gridThirteenRight) coordinates <- gridThirteenRight ## End(Not run)
## Not run: # Returns a Grid with rank = 13 data(gridThirteenRight) coordinates <- gridThirteenRight ## End(Not run)
This returns a thirteen grid upwards maze. These are standardized coordinates.
data(gridThirteenUp)
data(gridThirteenUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 13 data(gridThirteenUp) coordinates <- gridThirteenUp ## End(Not run)
## Not run: # Returns a Grid with rank = 13 data(gridThirteenUp) coordinates <- gridThirteenUp ## End(Not run)
This returns a three grid downwards maze. These are standardized coordinates.
data(gridThreeDown)
data(gridThreeDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = X data(gridThreeDown) coordinates <- gridThreeDown ## End(Not run)
## Not run: # Returns a Grid with rank = X data(gridThreeDown) coordinates <- gridThreeDown ## End(Not run)
This returns a three grid left maze. These are standardized coordinates.
data(gridThreeLeft)
data(gridThreeLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 3 data(gridThreeLeft) coordinates <- gridThreeLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 3 data(gridThreeLeft) coordinates <- gridThreeLeft ## End(Not run)
This returns a three grid left maze. These are standardized coordinates.
data(gridThreeRight)
data(gridThreeRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 3 data(gridThreeRight) coordinates <- gridThreeRight ## End(Not run)
## Not run: # Returns a Grid with rank = 3 data(gridThreeRight) coordinates <- gridThreeRight ## End(Not run)
This returns a three grid upwards maze. These are standardized coordinates.
data(gridThreeUp)
data(gridThreeUp)
A data frame with 2 columns
start, coordinates of Start Node.
end, coordinates End Node.
## Not run: # Returns a Grid with rank = 3 data(gridThreeUp) coordinates <- gridThreeUp ## End(Not run)
## Not run: # Returns a Grid with rank = 3 data(gridThreeUp) coordinates <- gridThreeUp ## End(Not run)
This returns a twelve grid downards maze. These are standardized coordinates.
data(gridTwelveDown)
data(gridTwelveDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 12 data(gridTwelveDown) coordinates <- gridTwelveDown ## End(Not run)
## Not run: # Returns a Grid with rank = 12 data(gridTwelveDown) coordinates <- gridTwelveDown ## End(Not run)
This returns a twelve grid left maze. These are standardized coordinates.
data(gridTwelveLeft)
data(gridTwelveLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 12 data(gridTwelveLeft) coordinates <- gridTwelveLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 12 data(gridTwelveLeft) coordinates <- gridTwelveLeft ## End(Not run)
This returns a twelve grid right maze. These are standardized coordinates.
data(gridTwelveRight)
data(gridTwelveRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 12 data(gridTwelveRight) coordinates <- gridTwelveRight ## End(Not run)
## Not run: # Returns a Grid with rank = 12 data(gridTwelveRight) coordinates <- gridTwelveRight ## End(Not run)
This returns a twelve grid upwards maze. These are standardized coordinates.
data(gridTwelveUp)
data(gridTwelveUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 12 data(gridTwelveUp) coordinates <- gridTwelveUp ## End(Not run)
## Not run: # Returns a Grid with rank = 12 data(gridTwelveUp) coordinates <- gridTwelveUp ## End(Not run)
This returns a twenty grid right maze. These are standardized coordinates.
data(gridTwentyDown)
data(gridTwentyDown)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 20 data(gridTwentyDown) coordinates <- gridTwentyDown ## End(Not run)
## Not run: # Returns a Grid with rank = 20 data(gridTwentyDown) coordinates <- gridTwentyDown ## End(Not run)
This returns a twenty grid right maze. These are standardized coordinates.
data(gridTwentyLeft)
data(gridTwentyLeft)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 20 data(gridTwentyLeft) coordinates <- gridTwentyLeft ## End(Not run)
## Not run: # Returns a Grid with rank = 20 data(gridTwentyLeft) coordinates <- gridTwentyLeft ## End(Not run)
This returns a twenty grid right maze. These are standardized coordinates.
data(gridTwentyRight)
data(gridTwentyRight)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 20 data(gridTwentyRight) coordinates <- gridTwentyRight ## End(Not run)
## Not run: # Returns a Grid with rank = 20 data(gridTwentyRight) coordinates <- gridTwentyRight ## End(Not run)
This returns a twenty grid right maze. These are standardized coordinates.
data(gridTwentyUp)
data(gridTwentyUp)
A data frame with 2 columns
Coordinates of Start Node.
Coordinates End Node.
## Not run: # Returns a Grid with rank = 20 data(gridTwentyUp) coordinates <- gridTwentyUp ## End(Not run)
## Not run: # Returns a Grid with rank = 20 data(gridTwentyUp) coordinates <- gridTwentyUp ## End(Not run)
Calculate how many possible variation of black dotes for a given saturation.
howMany(rank, satPercent)
howMany(rank, satPercent)
rank |
This is the rank of the maze. |
satPercent |
The percentage of saturation. Between 0-1. |
Calculate how many possible variation of black dotes for a given saturation. The first node will not be a black dot.
Aiden Loe
howMany(rank=5, satPercent=0.5)
howMany(rank=5, satPercent=0.5)
This tells you all the node position in the maze.
lowerGrid(rank = 5)
lowerGrid(rank = 5)
rank |
This is the rank of the maze. |
The construction of the maze is first created in a symmetrical format. However, only half of the nodes are kept in order to create the actual maze. Hence, this function calculates the nodePosition of the actual maze.
Aiden Loe
lowerGrid(3)
lowerGrid(3)
This returns the maximum score for a given rank and a given colour node position.
maxScore(nodePosition)
maxScore(nodePosition)
nodePosition |
The position of the black dots. |
The maxScore function returns the maximum score for a given rank and a given colour node positions. You need to use the colour node position function first.
Aiden Loe
nodePosition <- np(rank=3,satPercent=0.5,seed=1) maxScore(nodePosition=nodePosition)
nodePosition <- np(rank=3,satPercent=0.5,seed=1) maxScore(nodePosition=nodePosition)
The ability function returns the weighted score of the individual given his raw score (i.e. the number of black dotes collected).
mazeAbility(nodePosition, dot = 2, model = "t2")
mazeAbility(nodePosition, dot = 2, model = "t2")
nodePosition |
You need to calculate the nodePosition. |
dot |
This is the number of black dots. |
model |
There are 4 models to estimate ability (t1,t2,t3,t4). |
This function calculates the weighted score of the participant given the number of dots collected. The function adopts 4 different models which follows the Davies & Davies (1965) paper. The formula for is Model 1:
where is the total number of paths and
is the paths through the specified number of dots. The formula for Model 2:
where is the value with the maximum number of connected dots. The formula for Model 3:
where is the saturation value. The formula for Model 4 is:
We included all four models to calculate maze ability.
An 'ab' class is created which will be used for other functions in the package.
Aiden Loe and Maria Sanchez
nodePosition <- np(rank=6,satPercent=0.5,seed=1) mazeAbility(nodePosition,dot=3, model="t2")
nodePosition <- np(rank=6,satPercent=0.5,seed=1) mazeAbility(nodePosition,dot=3, model="t2")
This function tells us the difficulty level of the rank given a saturation and black node distribution
mazeDiff(nodePosition, model = "m1")
mazeDiff(nodePosition, model = "m1")
nodePosition |
This is the distribution of the colour node positions. |
model |
There are three types of model to select from: "m1", "m2" or "m3". |
This function tells us the difficulty level of the rank given a saturation and black node distribution. The calculation of the difficulty level follows the Davies & Davies (1965) paper. In the article, there are three ways to calculate maze difficulty. In Model 1, only two parameters were considered: rank and the number of possible paths through the maximum number of routes.
where is the total number of paths and
is the paths through the maximum number of dots. Model 2 includes the saturation parameter. This is calculated based on:
where is the saturation and
. The a value is recommended in the paper after using various values. Model 3 extends the second formula to include the minimum number of steps to pass through
.
where is the minimum steps to pass through
and
. The b value is recommended in the paper after using various values.
We included all three approaches to calculate maze difficulty. It was to incorporated all the possible parameters of the task features that may potentially influence maze difficulty.
Aiden Loe and Maria Sanchez
Davies, A. D., & Davies, M. G. (1965). The difficulty and graded scoing of Elithorn's
perceptual maze test. British Journal of Psychology, 56(2-3), 295-302.
#Black nodes distribution nodePosition <- np(rank=5,satPercent=0.5,seed=1) #calculate difficulty mazeDiff(nodePosition, model="m1")
#Black nodes distribution nodePosition <- np(rank=5,satPercent=0.5,seed=1) #calculate difficulty mazeDiff(nodePosition, model="m1")
This returns the estimate of various maze parameters.
mazeEst(nodePosition)
mazeEst(nodePosition)
nodePosition |
Tells you all the position of the black dots. |
This function calculates the count of all the possible black node routes, the maximum score one can achieve for a given rank of a colour node position, all the minimum routes possible, and all the possible routes.
The rank of the maze
The location of the coloured dots
The maximum score achievable in the maze.
All possible routes that passes a certain number of black dots
The minimum steps to achieve the maximum score
The number of paths with the minimum steps to achieve the maximum score.
All the paths with the minimum steps to achieve the maximum score.
The number of possible paths to achieve the maximum score.
All possible paths to achieve the maximum score.
Aiden Loe
Davies, A. D., & Davies, M. G. (1965). The difficulty and graded scoing of Elithorn's
perceptual maze test. British Journal of Psychology, 56(2-3), 295-302.
Davies, M. G., & Davies, D. M. (1965). Some analytical properties of Elithorn's
perceptual maze. Journal of Mathematical Psychology, 2(2), 371-380.
rank <- 10 nodePosition <- np(rank=10,satPercent=0.5,seed=16) c <- mazeEst(nodePosition)
rank <- 10 nodePosition <- np(rank=10,satPercent=0.5,seed=16) c <- mazeEst(nodePosition)
The mazeGen package provides a function to generate the Perceptual Elithorn Maze as well as the methods for calculating task difficulty without incorporating reponses.
The mazeHTML
or the link{mazeObject}
function will allow you to generate the mazes according to certain specification. Currently the maximum number of row is 18. To get a summary of the maze parameters, users can use the mazeEst
.
For most functions to work, you need to first get the random distribution of the coloured nodes. Using the np
function will allow you to do that. There are occasions where one might want to select the number of paths for a maximum score for a given maze with a known saturation.
Calculating the maximum score for the random coloured node distribution can be done using the maxScore
function. At this stage, there is no way in generating a maze based on a pre-determined specific maximum score. The maze generation is largely depending on the rank, and the saturation of the coloured nodes.
The genPathSeed
function will search for the seed that returns the specific paths for a given maximum score when using it in the np
function. Alternatively, one may use the genEMLseed
function to search for the seed that returns the specific paths for a maximum score, with the notion that the minimum number of steps to achieve maximum score is the same for all possible paths. Once the seed is return, one can use it in the np
function. Bear in mind that the SEED is restricted to the local computer.
The difficulty of the maze can be calculated using the mazeDiff
. Using this approch does not consider player's responses but just the parameters involve to create the maze. Three models are used to calculate the maze difficulty using the function.
The ability score of the participants can be calculated using the mazeAbility
. There are 4 different models used to calcuate the participants' ability.
Use the mazeHTML
function to generate the maze in a HTML template or the mazeObject
function to generate the maze in an R object. To use it with concerto, it is better to generate the maze in the R object and push it into a HTML template. This will allow an immediate generation of the maze in test mode.
Davies, A. D., & Davies, M. G. (1965). The difficulty and graded scoing of Elithorn's
perceptual maze test. British Journal of Psychology, 56(2-3), 295-302.
Davies, M. G., & Davies, D. M. (1965). Some analytical properties of Elithorn's
perceptual maze. Journal of Mathematical Psychology, 2(2), 371-380.
This function generates an Elithorn Maze
mazeHTML(rank = 3, satPercent = 0.5, seed = 1, grid = NULL, wd = NULL, background = "#7abcff", boxBackground = "#66CDAA", fontColour = "white", Timer = TRUE, concerto = "C5")
mazeHTML(rank = 3, satPercent = 0.5, seed = 1, grid = NULL, wd = NULL, background = "#7abcff", boxBackground = "#66CDAA", fontColour = "white", Timer = TRUE, concerto = "C5")
rank |
This is the Rank of the maze. |
satPercent |
The saturation of the number of black dots created for a given grid. Range between 0-1. |
seed |
To make sure that the randomness of the created black dots is captured and not repeated. |
grid |
is the grid of the maze |
wd |
is the working directory to save the HTML source code in. If not given, the file will be saved in the default working directory. |
background |
The background colour of the page. |
boxBackground |
The background colour of the box. |
fontColour |
The font colour of the instructions. |
Timer |
If True, a time limit of 1 mintues and 30 seconds is given per question. |
concerto |
The code varies between concerto version "C4" and "C5". |
This function creates a maze and is saved into your working directory. A grid object needs to be called out first before runing the maze function. The grid object needs to be the same as the rank given.
Aiden Loe
rank <- 3 satPercent <- 0.5 #Grid must be same as rank grid <- gridThreeUp #Folder to save html/ #setwd("~/desktop") #filePath<- getwd() #Generate item mazeHTML(rank,satPercent,seed=5,grid = grid,wd=NULL, background="#7abcff",boxBackground="#66CDAA", fontColour="white ", Timer=TRUE, concerto="C5")
rank <- 3 satPercent <- 0.5 #Grid must be same as rank grid <- gridThreeUp #Folder to save html/ #setwd("~/desktop") #filePath<- getwd() #Generate item mazeHTML(rank,satPercent,seed=5,grid = grid,wd=NULL, background="#7abcff",boxBackground="#66CDAA", fontColour="white ", Timer=TRUE, concerto="C5")
This function generates the html template of the Elithorn Maze in an R object.
mazeObject(rank = 3, satPercent = 0.5, seed = 1, grid = NULL, background = "#7abcff", boxBackground = "#66CDAA", fontColour = "white", Timer = TRUE, concerto = "C5")
mazeObject(rank = 3, satPercent = 0.5, seed = 1, grid = NULL, background = "#7abcff", boxBackground = "#66CDAA", fontColour = "white", Timer = TRUE, concerto = "C5")
rank |
This is the Rank of the maze. |
satPercent |
The saturation of the number of black dots created for a given grid. Range between 0-1. |
seed |
To make sure that the randomness of the created black dots is captured and not repeated. |
grid |
is the grid of the maze |
background |
The background colour of the page. |
boxBackground |
The background colour of the box. |
fontColour |
The font colour of the instructions. |
Timer |
If True, a time limit of 4 mintues is given per question. |
concerto |
The code varies between concerto version "C4" and "C5". |
This function creates a plot with the maze blueprint into your working directory. A grid object needs to be called out first before runing the maze function. The grid object needs to be the same as the rank given.
Aiden Loe
rank <- 3 satPercent <- 0.5 #Grid must be same as rank grid <- gridThreeUp #Generate item mazeObject(rank,satPercent,seed=5,grid = grid, background="#7abcff",boxBackground="#66CDAA", fontColour="white ", Timer=TRUE, concerto="C5")
rank <- 3 satPercent <- 0.5 #Grid must be same as rank grid <- gridThreeUp #Generate item mazeObject(rank,satPercent,seed=5,grid = grid, background="#7abcff",boxBackground="#66CDAA", fontColour="white ", Timer=TRUE, concerto="C5")
Returns the colour node position. You need to use the node position function first.
np(rank = 3, satPercent = 0.5, seed = 1)
np(rank = 3, satPercent = 0.5, seed = 1)
rank |
This is the rank of the maze. |
satPercent |
Percentage of saturation. |
seed |
To always get the same position for a local computer. |
This function will not sample from the first node position. If you consider sampling from the first node, then in javascript, the summing of the black dotes need to begin from 1 rather than 0. To keep it simple, always ensure that the first node is not sampled as a black dot.
A 'np' class which will be used for other functions in the package.
Aiden Loe
np(rank=3,satPercent=0.5,seed=1)
np(rank=3,satPercent=0.5,seed=1)
The node length calculates all the nodes on the longest row for a given rank.
topNodes(rank)
topNodes(rank)
rank |
This is the Rank of the maze. |
This needs to have a rank value of greater than 1. This is needed so that you can cross check how many coloured nodes are located on the longest row.
Aiden Loe
rank <-3 topNodes(rank)
rank <-3 topNodes(rank)