Skip to content

sam::DefaultResearchStrategy

Module: Research Strategies

The deceleration of the default research strategy. More...

#include <ResearchStrategy.h>

Inherits from sam::ResearchStrategy

Public Classes

Name
struct Parameters
The parameters of the strategy.

Public Functions

Name
DefaultResearchStrategy(const Parameters & p)
virtual std::optional< SubmissionPool > selectOutcomeFromExperiment(Experiment * experiment, PolicyChainSet & pchain_set) override
Returns the result of applying the policy chain set on the Experiment.
virtual std::optional< SubmissionPool > selectOutcomeFromPool(SubmissionPool & spool, PolicyChainSet & pchain_set) override
virtual bool willStartHacking(std::optional< SubmissionPool > & subs) override
virtual bool willContinueHacking(Experiment * experiment, PolicyChain & pchain) override
Determines whether or not the researcher is going to continue hacking.
virtual bool willContinueHacking(std::optional< SubmissionPool > & subs, PolicyChain & pchain) override
Determines whether or not the researcher is going to continue hacking.
virtual bool willContinueReplicating(SubmissionPool & subs) override
Determines whether or not the replication procedure is going to place.

Public Attributes

Name
Parameters params

Additional inherited members

Public Functions inherited from sam::ResearchStrategy

Name
virtual ~ResearchStrategy() =0
ResearchStrategy()
bool willBeSubmitting(const std::optional< SubmissionPool > & sub, PolicyChain & pchain)
void reset()
Resets the internal state of the research strategy.
std::optional< SubmissionPool > stashedSubmissions()
Returns a copy of the stashed_submissions.
void saveOutcomes(Experiment & experiment, PolicyChain & pchain)
std::optional< SubmissionPool > selectOutcome(Experiment & experiment, PolicyChainSet & pchain_set)
Returns the result of applying the PolicyChainSet on the Experiment.
std::optional< SubmissionPool > selectBetweenSubmissions(SubmissionPool & spool, PolicyChainSet & pchain_set)
Returns the result of applying the PolicyChainSet on the submission pool.
std::unique_ptr< ResearchStrategy > build(json & research_strategy_config)
ResearchStrategy factory method.

Public Attributes inherited from sam::ResearchStrategy

Name
sol::state lua
PolicyChainSet initial_selection_policies
PolicyChain submission_decision_policies
PolicyChainSet between_stashed_selection_policies
PolicyChainSet between_reps_policies
PolicyChain will_not_start_hacking_decision_policies
PolicyChain will_not_continue_replicating_decision_policy
PolicyChain stashing_policy

Protected Attributes inherited from sam::ResearchStrategy

Name
std::optional< SubmissionPool > submission_candidates
SubmissionPool stashed_submissions

Detailed Description

class sam::DefaultResearchStrategy;

The deceleration of the default research strategy.

See: Researcher::research()

Note: Researcher is in charge of research strategy and it executes its command personally.

        The default research strategy is the only available strategy at
        the moment. It is designed to use all the policies explicitly
        and do not intervene with the given logic. Therefore, it has a
        very linear flow.

Public Functions Documentation

function DefaultResearchStrategy

inline explicit DefaultResearchStrategy(
    const Parameters & p
)

function selectOutcomeFromExperiment

virtual std::optional< SubmissionPool > selectOutcomeFromExperiment(
    Experiment * experiment,
    PolicyChainSet & pchain_set
) override

Returns the result of applying the policy chain set on the Experiment.

Parameters:

  • experiment The experiment
  • pchain_set The policy chain set

Return: Returns a list of submissions, if any.

Reimplements: sam::ResearchStrategy::selectOutcomeFromExperiment

If necessasry (ie., if stashing_policy is specified), it stashes some submissions from the experiment and also it returns the result of applying policy chain set on the experiment, if any.

TodoCheck if you can implement this a bit nicer

function selectOutcomeFromPool

virtual std::optional< SubmissionPool > selectOutcomeFromPool(
    SubmissionPool & spool,
    PolicyChainSet & pchain_set
) override

Parameters:

  • spool The submission pool
  • pchain_set The policy chain set

Return: Returns a list of submissions, if any.

Reimplements: sam::ResearchStrategy::selectOutcomeFromPool

Returns the results of applying the policy chain set on the list of submissions

function willStartHacking

virtual bool willStartHacking(
    std::optional< SubmissionPool > & subs
) override

Parameters:

  • subs A list of submission candidates

Return: Returns true if the researcher has to proceed with the hacking strategies.

Note: Basically, if at least one of the submissions satisfy all of the criteria, the researcher will not commit to the hacking.

Reimplements: sam::ResearchStrategy::willStartHacking

Determines whether or not the researcher is going to starting the hacking / procedure

In this case, researcher checks if the list of current submissions complies with will_not_start_hacking_decision_policies; if so, it will NOT start hacking; otherwise, it WILL start the hacking procedure, and proceed to either stashing or replicating.

function willContinueHacking

virtual bool willContinueHacking(
    Experiment * experiment,
    PolicyChain & pchain
) override

Determines whether or not the researcher is going to continue hacking.

Parameters:

  • pchain a reference to the given policy chain

Return: Retruns true is the researcher should proceed with the next hacking strategy

Reimplements: sam::ResearchStrategy::willContinueHacking

Similar to the willStartHacking() checks whether any of the dependent variables are satisfying all pchain policies.

function willContinueHacking

virtual bool willContinueHacking(
    std::optional< SubmissionPool > & subs,
    PolicyChain & pchain
) override

Determines whether or not the researcher is going to continue hacking.

Parameters:

  • subs The list of submissions, if any
  • pchain The policy chain

Return: Retruns true if the researcher should proceed with the next hacking strategy

Reimplements: sam::ResearchStrategy::willContinueHacking

Overload of the willContinueHacking() that operates on a list of submissions instead of an experiment.

function willContinueReplicating

virtual bool willContinueReplicating(
    SubmissionPool & subs
) override

Determines whether or not the replication procedure is going to place.

Parameters:

  • subs A list of submission candidates

Return: Retruns true if the researcher has to continue the replication procedure

Reimplements: sam::ResearchStrategy::willContinueReplicating

Similar to the willContinueHacking(), but uses will_not_continue_replicating_decision_policy instead.

Public Attributes Documentation

variable params

Parameters params;

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


Last update: 2021-09-18