2022-06-10 11:50:59 +02:00
|
|
|
openapi: 3.0.3
|
|
|
|
info:
|
2022-06-20 17:33:20 +02:00
|
|
|
version: 0.3.0
|
2022-06-10 11:50:59 +02:00
|
|
|
title: Schemata for command instructions
|
2022-06-11 16:07:23 +02:00
|
|
|
servers:
|
|
|
|
- url: "."
|
2022-06-10 11:50:59 +02:00
|
|
|
paths: {}
|
|
|
|
components:
|
|
|
|
schemas:
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Commands
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Commands:
|
|
|
|
description: |-
|
|
|
|
List of commands to test algorithms/datastructures.
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/components/schemas/Command"
|
|
|
|
default: []
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Command
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Command:
|
|
|
|
description: |-
|
|
|
|
Instructions for command to call
|
2022-06-11 16:07:23 +02:00
|
|
|
type: object
|
2022-06-10 11:50:59 +02:00
|
|
|
required:
|
|
|
|
- name
|
2022-06-11 16:07:23 +02:00
|
|
|
properties:
|
2022-06-10 11:50:59 +02:00
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
|
|
|
additionalProperties: true
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-14 01:34:44 +02:00
|
|
|
# Algorithm: Tarjan
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandTarjan:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of Tarjan-Algorithm
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
2022-06-10 16:04:30 +02:00
|
|
|
- nodes
|
|
|
|
- edges
|
2022-06-10 11:50:59 +02:00
|
|
|
properties:
|
2022-06-11 16:07:23 +02:00
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
2022-06-10 16:04:30 +02:00
|
|
|
nodes:
|
2022-06-10 16:05:15 +02:00
|
|
|
type: array
|
2022-06-11 16:07:23 +02:00
|
|
|
items:
|
|
|
|
anyOf:
|
|
|
|
- type: integer
|
|
|
|
- type: number
|
|
|
|
- type: string
|
2022-06-10 16:04:30 +02:00
|
|
|
edges:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: array
|
|
|
|
minItems: 2
|
|
|
|
maxItems: 2
|
2022-06-11 16:07:23 +02:00
|
|
|
items:
|
|
|
|
anyOf:
|
|
|
|
- type: integer
|
|
|
|
- type: number
|
|
|
|
- type: string
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-14 01:34:44 +02:00
|
|
|
# Algorithm: TSP
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandTsp:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of TSP-Algorithm
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- optimise
|
|
|
|
- dist
|
|
|
|
properties:
|
2022-06-11 16:07:23 +02:00
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
2022-06-10 11:50:59 +02:00
|
|
|
dist:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: number
|
|
|
|
optimise:
|
2022-06-14 01:34:44 +02:00
|
|
|
$ref: '#/components/schemas/EnumOptimiseMode'
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-14 01:34:44 +02:00
|
|
|
# Algorithm: Hirschberg
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandHirschberg:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of Hirschberg-Algorithm
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
2022-06-10 12:44:04 +02:00
|
|
|
- word1
|
|
|
|
- word2
|
2022-06-10 11:50:59 +02:00
|
|
|
properties:
|
2022-06-11 16:07:23 +02:00
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
2022-06-10 11:50:59 +02:00
|
|
|
word1:
|
|
|
|
description: Word that gets placed vertically in algorithm.
|
|
|
|
type: string
|
|
|
|
word2:
|
|
|
|
description: Word that gets placed horizontally in algorithm
|
|
|
|
type: string
|
|
|
|
once:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-06-14 01:34:44 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Algorithm: Rucksack Branch & Bound
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandRucksack:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of Branch & Bound-Algorithm for the Rucksack-Problem
|
|
|
|
type: object
|
|
|
|
required:
|
2022-06-20 15:55:43 +02:00
|
|
|
- name
|
2022-06-14 01:34:44 +02:00
|
|
|
- algorithm
|
2022-06-14 14:40:02 +02:00
|
|
|
- max-cost
|
|
|
|
- costs
|
2022-06-14 01:34:44 +02:00
|
|
|
- values
|
|
|
|
properties:
|
2022-06-20 15:55:43 +02:00
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
2022-06-14 01:34:44 +02:00
|
|
|
algorithm:
|
|
|
|
$ref: '#/components/schemas/EnumRucksackAlgorithm'
|
|
|
|
allow-fractional:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-06-14 14:40:02 +02:00
|
|
|
max-cost:
|
|
|
|
description: Upper bound for total cost of rucksack.
|
2022-06-14 01:34:44 +02:00
|
|
|
type: number
|
|
|
|
minimum: 0
|
2022-06-14 14:40:02 +02:00
|
|
|
costs:
|
|
|
|
description: Array of cost for each item (e.g. volume, weight, price, time, etc.).
|
2022-06-14 01:34:44 +02:00
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: number
|
|
|
|
exclusiveMinimum: 0
|
|
|
|
values:
|
2022-06-14 14:40:02 +02:00
|
|
|
description: Value extracted from each item (e.g. energy, profit, etc.).
|
2022-06-14 01:34:44 +02:00
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: number
|
|
|
|
items:
|
|
|
|
description: Optional names of the items (if empty, defaults to 1-based indexes).
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
default: []
|
2022-06-20 15:55:43 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-21 17:24:30 +02:00
|
|
|
# Algorithm: Random Walk
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandRandomWalk:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of random walks to determine local extrema in a fitness landscape
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- algorithm
|
|
|
|
- landscape
|
|
|
|
- optimise
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
|
|
|
algorithm:
|
|
|
|
$ref: '#/components/schemas/EnumWalkMode'
|
|
|
|
landscape:
|
|
|
|
$ref: '#/components/schemas/DataTypeLandscapeGeometry'
|
|
|
|
optimise:
|
|
|
|
$ref: '#/components/schemas/EnumOptimiseMode'
|
2022-06-21 19:01:13 +02:00
|
|
|
coords-init:
|
|
|
|
description: Initial co-ordinates to start the algorithm.
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: integer
|
|
|
|
minItems: 1
|
|
|
|
temperature-init:
|
|
|
|
type: float
|
|
|
|
default: 1.
|
2022-06-21 17:24:30 +02:00
|
|
|
annealing:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-06-21 19:01:13 +02:00
|
|
|
one-based:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-06-21 17:24:30 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Algorithm: Genetic Algorithm
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandGenetic:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of the Genetic algorithm
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- population
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
|
|
|
population:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
minItems: 2
|
|
|
|
# maxItems: 2 # FIXME: does not work!
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-20 15:55:43 +02:00
|
|
|
# Algorithm: Euklidean algorithm
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandEuklid:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of the Euklidean gcd-algorithm
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- numbers
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
|
|
|
numbers:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: integer
|
|
|
|
exclusiveMinimum: 0
|
|
|
|
minItems: 2
|
|
|
|
maxItems: 2
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Algorithm: Pollard's rho
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
CommandPollard:
|
|
|
|
description: |-
|
|
|
|
Instructions for execution of the Pollard's rho algorithm
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- number
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
$ref: '#/components/schemas/EnumAlgorithmNames'
|
|
|
|
number:
|
|
|
|
type: integer
|
|
|
|
exclusiveMinimum: 0
|
2022-06-20 17:24:28 +02:00
|
|
|
x-init:
|
|
|
|
type: integer
|
|
|
|
default: 2
|
|
|
|
minimum: 2
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-21 17:24:30 +02:00
|
|
|
# Data-type Landscape Geometry, Landscape Values
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
DataTypeLandscapeGeometry:
|
|
|
|
description: |-
|
|
|
|
Structure for the geometry of a fitness landscape
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- neighbourhoods
|
2022-06-21 19:01:13 +02:00
|
|
|
- labels
|
2022-06-21 17:24:30 +02:00
|
|
|
- values
|
|
|
|
properties:
|
|
|
|
neighbourhoods:
|
|
|
|
$ref: '#/components/schemas/DataTypeLandscapeNeighbourhoods'
|
2022-06-21 19:01:13 +02:00
|
|
|
labels:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
minItems: 1
|
2022-06-21 17:24:30 +02:00
|
|
|
values:
|
|
|
|
$ref: '#/components/schemas/DataTypeLandscapeValues'
|
|
|
|
DataTypeLandscapeNeighbourhoods:
|
|
|
|
description: |-
|
|
|
|
Options for the definition of discrete neighbourhoods of a fitness landscape
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- metric
|
|
|
|
properties:
|
|
|
|
radius:
|
|
|
|
type: number
|
|
|
|
minimum: 1
|
|
|
|
default: 1
|
|
|
|
metric:
|
|
|
|
$ref: '#/components/schemas/EnumLandscapeMetric'
|
|
|
|
DataTypeLandscapeValues:
|
|
|
|
description: |-
|
|
|
|
A (potentially multi-dimensional) array of values for the fitness landscape.
|
|
|
|
oneOf:
|
|
|
|
- type: array
|
|
|
|
items:
|
|
|
|
type: number
|
|
|
|
- type: array
|
|
|
|
items:
|
|
|
|
$ref: '#/components/schemas/DataTypeLandscapeValues'
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-10 11:50:59 +02:00
|
|
|
# Enum Algorithm Names
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
EnumAlgorithmNames:
|
|
|
|
description: |-
|
|
|
|
Enumeration of possible algorithm options.
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- TARJAN
|
|
|
|
- TSP
|
|
|
|
- HIRSCHBERG
|
2022-06-14 01:34:44 +02:00
|
|
|
- RUCKSACK
|
2022-06-21 17:24:30 +02:00
|
|
|
- RANDOM-WALK
|
|
|
|
- GENETIC
|
2022-06-20 15:55:43 +02:00
|
|
|
- EUKLID
|
|
|
|
- POLLARD-RHO
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-14 01:34:44 +02:00
|
|
|
# Enum Optimise Mode
|
2022-06-10 11:50:59 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-06-14 01:34:44 +02:00
|
|
|
EnumOptimiseMode:
|
2022-06-10 11:50:59 +02:00
|
|
|
description: |-
|
2022-06-14 01:34:44 +02:00
|
|
|
Enumeration of optimisation modi.
|
2022-06-10 11:50:59 +02:00
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- MIN
|
|
|
|
- MAX
|
2022-06-14 01:34:44 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Enum Rucksack mode for algorithm
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
EnumRucksackAlgorithm:
|
|
|
|
description: |-
|
|
|
|
Enumeration of mode for Rucksack problem
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- GREEDY
|
|
|
|
- BRANCH-AND-BOUND
|
2022-06-21 17:24:30 +02:00
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Enum Type of walk mode for fitness walk algorithm
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
EnumWalkMode:
|
|
|
|
description: |-
|
|
|
|
Enumeration of walk mode for fitness walk algorithm
|
|
|
|
- `ADAPTIVE` - points uniformly randomly chosen from nbhd.
|
|
|
|
- `GRADIENT` - points uniformly randomly chosen amongst points in nbhd with steepest gradient.
|
|
|
|
- `METROPOLIS` - points uniformly randomly chosen from nbhd. or by entropy.
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- ADAPTIVE
|
|
|
|
- GRADIENT
|
|
|
|
- METROPOLIS
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
# Enum for metric for neighbourhoods in fitness landscape
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
EnumLandscapeMetric:
|
|
|
|
description: |-
|
|
|
|
Enumeration of mode for Rucksack problem
|
|
|
|
- `MAXIMUM` - `Q` is a neighbour of `P` <==> `max_i d(P_i, Q_i) <= r`
|
|
|
|
- `MANHATTAN` - `Q` is a neighbour of `P` <==> `sum_i d(P_i, Q_i) <= r`
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- MAXIMUM
|
|
|
|
- MANHATTAN
|