OPTK  0.1.2
Toolkit for global optimisation algorithms
Macros | Functions
random.cpp File Reference

This file implements a random search algorithm. More...

#include <optimisers/random.hpp>

Macros

#define get_val(type, ctype)
 

Functions

static void sample_double (inst::node *parent, sspace::param_t *p)
 
static void sample_int (inst::node *parent, sspace::param_t *p)
 

Detailed Description

This file implements a random search algorithm.

Copyright (C) 2020 Maxime Robeyns maxim.nosp@m.erob.nosp@m.eyns@.nosp@m.gmai.nosp@m.l.com

Written for the ACRC, University of Bristol

Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.osedu.org/licenses/ECL-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LIcense For The Specific Language Governing permissions and limitations under the License.

Macro Definition Documentation

◆ get_val

#define get_val (   type,
  ctype 
)
Value:
{ \
type *tmp = static_cast<type *>(p); \
parent->add_item ( \
new ctype (p->get_name(), tmp->sample()) \
); \
break; \
}

Function Documentation

◆ sample_double()

static void sample_double ( inst::node parent,
sspace::param_t p 
)
static

Samples a single value from a parameter which returns a double, and adds it to the parent parameter instance.

Parameters
parentThe 'level' of the searh space instance to which to add the sampled value
pThe parameter description.

◆ sample_int()

static void sample_int ( inst::node parent,
sspace::param_t p 
)
static

As above, samples a single value from a parameter returning an integer.

Parameters
parentThe 'level' of the searh space instance to which to add the sampled value
pThe parameter description.