Skip to content

sam::PolicyChainSet

Module: Policy-related Modules

More...

#include <Policy.h>

Public Functions

Name
PolicyChain & operator[](std::size_t idx)
const PolicyChain & operator[](std::size_t idx) const
auto begin()
auto cbegin() const
auto end()
auto cend() const
size_t size() const
bool empty() const
PolicyChainSet() =default
PolicyChainSet(const PolicyChainSetDefinition & psets_defs, sol::state & lua)
PolicyChainSet constructor.
std::optional< std::vector< Submission > > operator()(Experiment & expr)
Returns a list of submissions from DVs of an experiment.
std::optional< std::vector< Submission > > operator()(std::vector< Submission > & spool)
Returns a list of submissions from a list of submissions.

Public Attributes

Name
std::vector< PolicyChain > pchains

Detailed Description

struct sam::PolicyChainSet;

PolicyChainSet is a collection of PolicyChains

They are mainly being used and interpreted like a list of preferences, and will be executed chronologically. Most function will go through the list one by one, and will quit as soon as one of the PolicyChains find at least on outcome from a given list of options, e.g., SubmissionPool or Experiment.

Public Functions Documentation

function operator[]

inline PolicyChain & operator[](
    std::size_t idx
)

function operator[]

inline const PolicyChain & operator[](
    std::size_t idx
) const

function begin

inline auto begin()

function cbegin

inline auto cbegin() const

function end

inline auto end()

function cend

inline auto cend() const

function size

inline size_t size() const

function empty

inline bool empty() const

function PolicyChainSet

PolicyChainSet() =default

function PolicyChainSet

PolicyChainSet(
    const PolicyChainSetDefinition & psets_defs,
    sol::state & lua
)

PolicyChainSet constructor.

function operator()

std::optional< std::vector< Submission > > operator()(
    Experiment & expr
)

Returns a list of submissions from DVs of an experiment.

Parameters:

  • expr The experiment

Return: An optional list of submissions

It chronologically applies all the available policy chains on the experiment and returns a list of submissions that are satisfies the firstPolicyChain in the list. If none of the chains were able to select any submissions, an empty std::optional will be returned.

function operator()

std::optional< std::vector< Submission > > operator()(
    std::vector< Submission > & spool
)

Returns a list of submissions from a list of submissions.

Parameters:

  • spool The pool of submissions

Return: An optional list of submissions

It chronologically applies all the available policy chains on the submission pool and returns a list of submissions that are satisfies the firstPolicyChain in the list. If none of the chains were able to select any submissions, an empty std::optional will be returned.

Public Attributes Documentation

variable pchains

std::vector< PolicyChain > pchains;

Updated on 29 June 2021 at 16:13:48 CEST


Last update: 2021-09-18