Learn R Programming

james.analysis (version 1.0.1)

readJAMES: Read analysis results from JSON file

Description

Read results from a JSON file produced by the analysis tools in the 'JAMES' extensions module.

Usage

readJAMES(file)

Arguments

file
string: path to a JSON file containing results produced by the analysis tools from the 'JAMES' extensions module.

Value

S3 object of class "james" containing the results of running a number of searches on a set of problems, where each search has been repeatedly applied for a number of runs. Data can be manipulated and extracted using the provided functions (see below).

See Also

Example data: james.

Data access and manipulations methods: reduceJAMES, mergeJAMES, getProblems, getSearches, getSearchRuns, getNumSearchRuns, getBestSolutionValues, getBestSolutions, getConvergenceTimes.

Plot functions: plotConvergence, boxplot.james.

Examples

Run this code
# get path to raw JSON file included in package distribution
json.file <- system.file("extdata", "james.json", package = "james.analysis")

# read results from file
james <- readJAMES(json.file)
summary(james)

# plot convergence curves for coconut data set
plotConvergence(james, problem = "coconut", min.time = 1000, max.time = 100000)

# create box plots of solution values (quality) and convergence times
boxplot(james, problem = "coconut")
boxplot(james, problem = "coconut", type = "time")

# extract solution values and convergence times for parallel tempering and random descent
values.pt <- getBestSolutionValues(james, problem = "coconut", search = "Parallel Tempering")
times.pt <- getConvergenceTimes(james, problem = "coconut", search = "Parallel Tempering")
values.rd <- getBestSolutionValues(james, problem = "coconut", search = "Random Descent")
times.rd <- getConvergenceTimes(james, problem = "coconut", search = "Random Descent")

# perform wilcoxon test to compare distributions across algorithms
values.test <- wilcox.test(values.pt, values.rd)
values.test
times.test <- wilcox.test(times.pt, times.rd)
times.test

# adjust p-values for multiple testing
p.adjust(c(values.test$p.value, times.test$p.value))

Run the code above in your browser using DataLab