Empirical
|
If we are in emscripten, make sure to include the header. More...
Namespaces | |
__impl_variadics_type_traits | |
cl | |
datastruct | |
detail | |
evo | |
Grid | |
internal | |
pack | |
serialize | |
tools | |
web | |
Classes | |
class | Action |
class | Action< RETURN(ARGS...)> |
class | Action< void(ARGS...)> |
class | ActionBase |
class | ActionManager |
class | ActionSize |
struct | AdaptFunction |
struct | AlertObj |
class | Angle |
class | array |
class | Author |
class | AvidaCPU_Base |
struct | AvidaCPU_InstLib |
class | AvidaGP |
class | AvidaHardware |
class | BaseTrait |
class | BatchConfig |
class | Bibliography |
class | BitMatrix |
A simple class to manage a COLS x ROWS matrix of bits. More... | |
class | BitSet |
class | BitVector |
A drop-in replacement for std::vector<bool>, but with extra bitwise logic features. More... | |
class | Body2D_Base |
class | Cache |
class | ce_array |
class | ce_array< T, 0 > |
class | ce_array< T, 1 > |
class | ce_string |
class | Circle2D |
class | CircleBody2D |
class | Citation |
class | ComboIDs |
class | Config |
Master configuration class that manages all of the settings. More... | |
class | ConfigEntry |
Base class for all configuration settings. More... | |
class | ConfigLexer |
class | ConfigManager |
class | ConfigManager_Base |
class | ConfigParser |
class | ContainerDataFile |
class | DataFile |
class | DataInterface |
A generic interface to a DataNode (so that you don't need to know the node's exact type) More... | |
class | DataInterface_Impl |
class | DataManager |
DataManagers handle sets of DataNode objects that all have the same tracking settings. More... | |
struct | DataModInfo |
struct | DataModInfo< data::Archive > |
struct | DataModInfo< data::FullRange > |
struct | DataModInfo< data::Stats > |
struct | DataModuleRequisiteAdd |
struct | DataModuleRequisiteAdd< CUR_MOD, MODS... > |
struct | DataModuleRequisiteAdd<> |
class | DataNode |
class | DataNode_Interface |
class | DataNode_Interface< VAL_TYPE, IntPack< IMODS... > > |
Outermost interface to all DataNode modules. More... | |
class | DataNodeModule |
Generic form of DataNodeModule (should never be used; trigger error!) More... | |
class | DataNodeModule< VAL_TYPE > |
Base form of DataNodeModule (available in ALL data nodes.) More... | |
class | DataNodeModule< VAL_TYPE, data::Archive, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Current, MODS... > |
class | DataNodeModule< VAL_TYPE, data::FullRange, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Histogram, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Info, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Log, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Pull, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Range, MODS... > |
class | DataNodeModule< VAL_TYPE, data::Stats, MODS... > |
struct | DFAStatus |
Structure to track the current status of a DFA. More... | |
class | DynamicString |
class | EventDrivenGP_AW |
A linear GP (inspired by AvidaGP) virtual hardware CPU that supports an event-driven programming paradigm. More... | |
class | EventLib |
struct | ExceptInfo |
Information about an exception that has occured. More... | |
class | File |
A class to maintin files for loading, writing, storing, and easy access to components. More... | |
class | fixed |
class | flex_function |
class | flex_function< R(ARGS...)> |
struct | FormatDataMods |
class | Function |
class | Function< RETURN(PARAMS...)> |
struct | function_traits |
struct | function_traits< ReturnType(ClassType::*)(Args...) const > |
class | FunctionSet |
class | FunctionSet< RETURN_T(ARGS...)> |
class | FunctionSet< void(ARGS...)> |
A specialized version of FunctionSet for void functions. More... | |
class | GenericFunction |
class | Graph |
A graph class that maintains a set of vertices (nodes) and edges (connecting pairs of nodes) More... | |
class | IndexMap |
class | InstLib |
InstLib maintains a set of instructions for use in virtual hardware. More... | |
struct | Instruction |
A single instruction in a linear genome. More... | |
struct | IntPack |
struct | IntPack< V1, Vs... > |
struct | IntPack<> |
struct | is_invocable |
struct | is_ptr_type |
struct | is_ptr_type< Ptr< T > > |
struct | is_ptr_type< T * > |
struct | is_ptr_type< T *const > |
class | Lexer |
A lexer with a set of token types (and associated regular expressions) More... | |
class | LinearCode |
class | Mancala |
class | memo_function |
class | memo_function< R(A1, A2, EXTRA...)> |
class | memo_function< R(ARG)> |
class | NKLandscape |
class | NKLandscapeMemo |
struct | null_t |
class | OrgInterface |
class | Othello8 |
Class for size-8 othello games. More... | |
struct | Othello_Base |
Base class for all sizes of Othello games. More... | |
class | Othello_Game |
Class for othello games of a specific size. More... | |
class | Parser |
Full information about a parser, including a lexer, symbols, and rules. More... | |
struct | ParseRule |
A rule for how parsing should work. More... | |
struct | ParseSymbol |
A single symbol in a grammer including the patterns that generate it. More... | |
class | PayoffMatrix |
class | Physics2D |
class | Point2D |
class | Processor |
class | Ptr |
struct | ptr_pair |
struct | ptr_pair< const T, T > |
struct | ptr_pair< T, const T > |
struct | ptr_pair< T, T > |
class | PtrInfo |
class | PtrTracker |
Facilitate tracking of all Ptr objects in this run. More... | |
class | ra_set |
class | Random |
A versatile and non-patterned pseudo-random-number generator (Mersenne Twister). More... | |
struct | RandomStdAdaptor |
This is an adaptor to make Random behave like a proper STL random number generator. More... | |
class | Range |
A range of values from a lower limit to and upper limit, of any provided type. More... | |
class | RawImage |
Fundamental information about a single image. More... | |
class | RegEx |
A basic regular expression handler. More... | |
struct | remove_ptr_type |
struct | remove_ptr_type< Ptr< T > > |
struct | remove_ptr_type< T * > |
class | Resource |
struct | run_and_ignore |
class | Signal |
Generic version of Signals; needs specialization to a function type.. More... | |
class | Signal< RETURN(ARGS...)> |
class | Signal< void(ARGS...)> |
Signals with void return. More... | |
class | SignalBase |
Base class for all signals. More... | |
class | SignalControl |
class | SignalKey |
SignalKey tracks a specific function triggered by a signal. For now, its just a value pair. More... | |
class | SignalManager |
class | SolveState |
class | StateGrid |
A StateGrid describes a map of grid positions to the current state of each position. More... | |
class | StateGridInfo |
Full information about the states available in a state grid and meanings of each state. More... | |
class | StateGridStatus |
Information about a particular agent on a state grid. More... | |
class | Surface2D |
class | Systematics |
A tool to track phylogenetic relationships among organisms. The systematics class tracks the relationships among all organisms based on the INFO_TYPE provided. If an offspring has the same value for INFO_TYPE as its parent, it is grouped into the same taxon. Otherwise a new Taxon is created and the old one is used as its parent in the phylogeny. If the provided INFO_TYPE is the organsism's genome, a traditional phylogeny is formed, with genotypes. If the organism's behavior/task set is used, then organisms are grouped by phenotypes. If the organsims's position is used, the evolutionary path through space is tracked. Any other aspect of organisms can be tracked this way as well. More... | |
class | SystematicsBase |
class | Taxon |
A Taxon represents a type of organism in a phylogeny. More... | |
class | tDFA |
struct | TemplateID |
struct | tIntMath |
struct | tIntMath< I > |
class | tNFA |
A dynamic NFA class, for easily building non-determanistic finite automata. More... | |
class | tNFA_State |
Information about the current full state (i.e., set of legal states) of an NFA. More... | |
struct | Token |
Information about a token instance from an input stream. More... | |
struct | TokenInfo |
Information about an individual token type to be processed within a Lexer. More... | |
struct | TrackedType |
The base class of any type to be tracked. More... | |
class | Trait |
class | TraitDef |
struct | TraitKey |
class | TraitManager |
class | TraitSet |
A TraitSet houses a collection of traits and can trigger them to all be evaluated at once. More... | |
struct | TupleHash |
Setup tuples to be able to be used in hash tables. More... | |
struct | TypeID |
struct | TypeID< bool > |
struct | TypeID< char > |
struct | TypeID< char16_t > |
struct | TypeID< char32_t > |
struct | TypeID< double > |
struct | TypeID< emp::array< T, N > > |
Ensure that emp::array works with TypeID. More... | |
struct | TypeID< emp::TypePack< T, Ts... > > |
struct | TypeID< emp::TypePack<> > |
struct | TypeID< emp::vector< T, Ts... > > |
struct | TypeID< float > |
struct | TypeID< int16_t > |
struct | TypeID< int32_t > |
struct | TypeID< int64_t > |
struct | TypeID< int8_t > |
struct | TypeID< std::string > |
struct | TypeID< T * > |
struct | TypeID< TEMPLATE< Ts... > > |
struct | TypeID< uint16_t > |
struct | TypeID< uint32_t > |
struct | TypeID< uint64_t > |
struct | TypeID< uint8_t > |
struct | TypeID< void > |
struct | TypePack |
struct | TypePack< T1, Ts... > |
struct | TypePack<> |
struct | TypeTracker |
struct | TypeTracker_Class |
class | UnorderedIndexMap |
class | valsort_map |
struct | variadic_concat |
struct | variadic_concat< Variadic< A... >, Rest... > |
struct | variadic_contains |
struct | variadic_contains< Needle, Variadic< U... >, Cmp > |
struct | variadic_filter |
struct | variadic_filter< Variadic< U... >, Filter > |
struct | variadic_index_of |
struct | variadic_index_of< Needle, Haystack< U... >, Cmp > |
struct | variadic_intersection |
struct | variadic_intersection< Cmp, Variadic< U... > > |
struct | variadic_intersection< Cmp, Variadic< U0... >, U1, U... > |
struct | variadic_remove_duplicates |
struct | variadic_remove_duplicates< Variadic< U... >, Cmp > |
struct | variadic_union |
struct | variadic_union< Cmp, Variadic< U... > > |
struct | variadic_union< Cmp, Variadic< U0... >, U1, U... > |
class | vector |
Build a debug wrapper emp::vector around std::vector. More... | |
class | vector< bool, Ts... > |
Build a specialized debug wrapper for emp::vector<bool> More... | |
class | WeightedGraph |
class | World |
Setup a World with a population of organisms that can evolve or deal with ecological effects. More... | |
class | World_iterator |
struct | World_MinDistInfo |
Build a class to track distances between organisms. More... | |
class | WorldPosition |
class | WorldVector |
A vector that can be indexed with a WorldPosition. More... | |
Typedefs | |
template<typename RUN_T > | |
using | BatchConfig = BatchConfig< RUN_T, RUN_T::config_t > |
template<emp::data... MODS> | |
using | ModPack = emp::IntPack<(int) MODS... > |
A shortcut for converting DataNode mod ID's to IntPacks. More... | |
template<typename T , emp::data... MODS> | |
using | DataMonitor = DataNode< T, data::Current, data::Info, data::Range, data::Stats, MODS... > |
template<typename T , emp::data... MODS> | |
using | DataLog = DataNode< T, data::Current, data::Info, data::Log, MODS... > |
template<typename T , emp::data... MODS> | |
using | DataArchive = DataNode< T, data::Info, data::Archive, data::FullRange, MODS... > |
template<typename ORG > | |
using | find_genome_t = decltype(Org2Genome< ORG >(true)) |
using | Othello = Othello_Game< 8 > |
using | Circle = Circle2D< double > |
using | Point = Point2D<> |
using | EventDrivenGP = EventDrivenGP_AW< 8 > |
A convenient shortcut for using EventDrivenGP_AW class with affinity width set to a default of 8. More... | |
template<int START, int END, int STEP = 1> | |
using | IntPackRange = typename internal::ip_range<(START >=END), START, END, STEP >::type |
template<typename T1 , typename... Ts> | |
using | first_type = T1 |
template<typename T1 , typename T2 , typename... Ts> | |
using | second_type = T2 |
template<typename T1 , typename T2 , typename T3 , typename... Ts> | |
using | third_type = T3 |
template<size_t ID, typename... Ts> | |
using | pack_id = typename internal::pack_id_impl< ID, Ts... >::type |
template<typename... Ts> | |
using | last_type = pack_id< sizeof...(Ts)-1, Ts... > |
template<typename REAL_TYPE , typename EVAL_TYPE > | |
using | sfinae_decoy = REAL_TYPE |
template<typename REAL_TYPE , typename EVAL_TYPE > | |
using | type_decoy = REAL_TYPE |
template<typename EVAL_TYPE > | |
using | bool_decoy = bool |
template<typename EVAL_TYPE > | |
using | int_decoy = int |
template<typename T , typename... U> | |
using | AdaptTemplate = typename internal::AdaptTemplateHelper< T, U... >::type |
template<typename T , typename U > | |
using | AdaptTemplate_Arg1 = typename internal::AdaptTemplateHelper_Arg1< T, U >::type |
template<typename T , template< typename... > class FILTER> | |
using | type_if = typename internal::EMP_eval_type< T, FILTER< T >::value >::type |
template<typename T > | |
using | remove_ptr_type_t = typename remove_ptr_type< T >::type |
template<typename... Variadics> | |
using | variadic_concat_t = typename variadic_concat< Variadics... >::type |
template<typename Variadic , template< typename > class Filter> | |
using | variadic_filter_t = typename variadic_filter< Variadic, Filter >::type |
template<typename Variadic , template< typename, typename > class... Cmp> | |
using | variadic_remove_duplicates_t = typename variadic_remove_duplicates< Variadic, Cmp... >::type |
template<template< typename, typename > class Cmp, typename... U> | |
using | variadic_union_t = typename variadic_union< Cmp, U... >::type |
template<template< typename, typename > class Cmp, typename... U> | |
using | variadic_intersection_t = typename variadic_intersection< Cmp, U... >::type |
template<typename T , int N> | |
using | TypePackFill = typename tp_pad< TypePack<>, T, N >::type |
using | DFA = tDFA< 128, uint8_t > |
Setup DFA to be a simple tDFA with the basic character set for symbols. More... | |
using | NFA = tNFA< 128, uint8_t > |
NFA is the most standard tNFA setup. More... | |
using | NFA_State = tNFA_State< 128, uint8_t > |
NFA_State is the most standard tNFA_State setup. More... | |
Enumerations | |
enum | PtrStatus { PtrStatus::DELETED =0, PtrStatus::ACTIVE, PtrStatus::ARRAY } |
enum | data { data::Current, data::Info, data::Log, data::Archive, data::Range, data::FullRange, data::Histogram, data::Stats, data::Pull, data::SignalReset, data::SignalData, data::SignalDatum, data::SignalRange, data::SignalLimits, data::UNKNOWN } |
A set of modifiers are available do describe DataNode. More... | |
enum | ScopeType { ScopeType::NONE =0, ScopeType::ROOT, ScopeType::BASIC, ScopeType::LOOP, ScopeType::FUNCTION } |
Functions | |
static const ExceptInfo & | GetEmptyExcept () |
Function to generate an empty exception (returned when an exception is checked, but none exist.) More... | |
static std::multimap< std::string, ExceptInfo > & | GetExceptMap () |
A map of all exceptions that have occurred and are awaiting to be dealt with. More... | |
void | TriggerExcept (const std::string &in_id, const std::string &in_desc, bool in_error=true) |
Provide information about an exception that needs to be triggered. More... | |
const ExceptInfo & | GetExcept (const std::string &id) |
Get the first waiting exception. More... | |
ExceptInfo | PopExcept (const std::string &id) |
Get and remove a waiting exception. More... | |
size_t | CountExcepts () |
How many exceptions are waiting to be dealt with? More... | |
bool | HasExcept () |
Are any exceptions waiting? More... | |
bool | HasExcept (const std::string &id) |
Are any exceptions of a particular type waiting? More... | |
void | ClearExcepts () |
Remove all waiting exceptions. More... | |
void | ClearExcept (const std::string &id) |
Remove all waiting exceptions of the desginated type. More... | |
template<typename... Ts> | |
void | Notify (Ts &&...args) |
Send information to a program user (via standard error in native mode, or alter in Emscripten) More... | |
template<typename... Ts> | |
void | NotifyWarning (Ts &&...msg) |
End user has done something possibly a problem. More... | |
template<typename... Ts> | |
void | NotifyError (Ts &&...msg) |
End user has done something resulting in an non-recoverable problem. More... | |
template<typename... Ts> | |
void | LibraryWarning (Ts &&...msg) |
Library user has made an error in how they are using the library. More... | |
template<typename... Ts> | |
void | LibraryError (Ts &&...msg) |
Library user has made an error in how they are using the library. More... | |
template<typename... Ts> | |
void | InternalError (Ts &&...msg) |
Original library implementers must have made an error. More... | |
void | SetPtrDebug (bool _d=true) |
bool | GetPtrDebug () |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out, const emp::Ptr< T > &ptr) |
template<typename T , typename... Ts> | |
std::istream & | operator>> (std::istream &is, emp::Ptr< T > &ptr) |
template<typename T > | |
Ptr< T > | ToPtr (T *_in, bool own=false) |
Convert a T* to a Ptr<T>. By default, don't track. More... | |
template<typename T > | |
Ptr< T > | TrackPtr (T *_in, bool own=true) |
Convert a T* to a Ptr<T> that we DO track. More... | |
template<typename T , typename... ARGS> | |
Ptr< T > | NewPtr (ARGS &&...args) |
Create a new Ptr of the target type; use the args in the constructor. More... | |
template<typename T > | |
Ptr< T > | CopyPtr (Ptr< T > in) |
Copy an object pointed to and return a Ptr to the copy. More... | |
template<typename T > | |
emp::vector< Ptr< T > > | CopyPtrs (const emp::vector< Ptr< T >> &in) |
Copy a vector of objects pointed to; return a vector of Ptrs to the new copies. More... | |
template<typename T > | |
emp::vector< Ptr< T > > | ClonePtrs (const emp::vector< Ptr< T >> &in) |
Copy a vector of objects pointed to by using their Clone() member function; return vector. More... | |
template<typename T , typename... ARGS> | |
Ptr< T > | NewArrayPtr (size_t array_size, ARGS &&...args) |
Create a pointer to an array of objects. More... | |
template<typename ForwardIterator , typename OutputIterator , typename RNG > | |
void | sample_with_replacement (ForwardIterator first, ForwardIterator last, OutputIterator ofirst, OutputIterator olast, RNG rng) |
Draw a sample (with replacement) from an input range, copying to the output range. More... | |
template<typename RETURN , typename... ARGS> | |
auto | make_action (const std::function< RETURN(ARGS...)> &in_fun, const std::string &name="") |
Build an action object using this function. More... | |
template<typename CONTAINER > | |
ContainerDataFile< CONTAINER > | MakeContainerDataFile (std::function< CONTAINER(void)> fun, const std::string &filename, const std::string &b="", const std::string &s=",", const std::string &e="\n") |
template<typename VAL_TYPE , emp::data... EXTRA> | |
DataInterface * | MakeDataInterface () |
template<typename ORG > | |
void | ResourceSelect (World< ORG > &world, const emp::vector< std::function< double(const ORG &)> > &extra_funs, emp::vector< emp::Resource > &pools, size_t t_size, size_t tourny_count=1, double frac=.0025, double max_bonus=5, double cost=0, bool use_base=true) |
template<typename taxon_t > | |
int | LineageLength (Ptr< taxon_t > taxon) |
template<typename taxon_t > | |
int | CountMutSteps (Ptr< taxon_t > taxon, std::string type="substitution") |
template<typename taxon_t > | |
int | CountMutSteps (Ptr< taxon_t > taxon, emp::vector< std::string > types) |
template<typename taxon_t > | |
int | CountMuts (Ptr< taxon_t > taxon, std::string type="substitution") |
template<typename taxon_t > | |
int | CountMuts (Ptr< taxon_t > taxon, emp::vector< std::string > types) |
template<typename taxon_t > | |
int | CountDeleteriousSteps (Ptr< taxon_t > taxon) |
template<typename taxon_t > | |
int | CountPhenotypeChanges (Ptr< taxon_t > taxon) |
template<typename taxon_t > | |
int | CountUniquePhenotypes (Ptr< taxon_t > taxon) |
template<typename WORLD_TYPE > | |
DataFile & | AddPhylodiversityFile (WORLD_TYPE &world, int systematics_id=0, const std::string &fpath="phylodiversity.csv") |
template<typename WORLD_TYPE > | |
DataFile & | AddLineageMutationFile (WORLD_TYPE &world, int systematics_id=0, const std::string &fpath="lineage_mutations.csv", emp::vector< std::string > mut_types={"substitution"}) |
template<typename WORLD , typename ORG > | |
void | SetDefaultFitFun (WORLD &world) |
template<typename WORLD , typename ORG > | |
void | SetDefaultMutFun (WORLD &world) |
template<typename WORLD , typename ORG > | |
void | SetDefaultPrintFun (WORLD &world) |
template<typename WORLD , typename ORG > | |
void | SetDefaultGetGenomeFun (WORLD &world) |
template<typename ORG > | |
void | EliteSelect (World< ORG > &world, size_t e_count=1, size_t copy_count=1) |
template<typename ORG > | |
void | RandomSelect (World< ORG > &world, size_t r_count=1, size_t copy_count=1) |
template<typename ORG > | |
void | TournamentSelect (World< ORG > &world, size_t t_size, size_t tourny_count=1) |
template<typename ORG > | |
void | RouletteSelect (World< ORG > &world, size_t count=1) |
template<typename ORG > | |
void | LexicaseSelect (World< ORG > &world, const emp::vector< std::function< double(ORG &)> > &fit_funs, size_t repro_count=1, size_t max_funs=0) |
template<typename ORG > | |
void | EcoSelect (World< ORG > &world, const emp::vector< std::function< double(ORG &)> > &extra_funs, const emp::vector< double > &pool_sizes, size_t t_size, size_t tourny_count=1) |
template<typename ORG > | |
void | EcoSelect (World< ORG > &world, const emp::vector< typename World< ORG >::fun_calc_fitness_t > &extra_funs, double pool_sizes, size_t t_size, size_t tourny_count=1) |
EcoSelect can be provided a single value if all pool sizes are identical. More... | |
template<typename ORG > | |
void | SetPools (World< ORG > &world, size_t num_pools, size_t pool_size, bool synchronous_gen=false) |
template<typename ORG > | |
void | SetMapElites (World< ORG > &world, TraitSet< ORG > traits, const emp::vector< size_t > &trait_counts) |
template<typename ORG > | |
void | SetMapElites (World< ORG > &world, TraitSet< ORG > traits) |
template<typename ORG > | |
void | SetMapElites (World< ORG > &world, const emp::vector< size_t > &trait_counts) |
template<typename ORG > | |
void | SetMapElites (World< ORG > &world) |
template<typename ORG > | |
void | SetDiverseElites (World< ORG > &world, TraitSet< ORG > traits, size_t world_size) |
This first version will setup a Diverse-Elites world and specify traits to use. More... | |
template<typename ORG > | |
void | SetDiverseElites (World< ORG > &world, size_t world_size) |
Setup a Diverse-Elites world, given the provided world already has set of phenotypes. More... | |
template<typename TEST > | |
constexpr bool | has_type () |
template<typename TEST , typename FIRST , typename... OTHERS> | |
constexpr bool | has_type () |
template<typename TEST > | |
constexpr size_t | count_type () |
template<typename TEST , typename FIRST , typename... OTHERS> | |
constexpr size_t | count_type () |
template<typename TEST_T , typename... Ts> | |
constexpr int | get_type_index () |
template<typename TYPE1 > | |
constexpr bool | has_unique_first_type () |
template<typename TYPE1 > | |
constexpr bool | has_unique_types () |
template<typename TYPE1 , typename TYPE2 , typename... TYPE_LIST> | |
constexpr bool | has_unique_first_type () |
template<typename TYPE1 , typename TYPE2 , typename... TYPE_LIST> | |
constexpr bool | has_unique_types () |
template<template< typename... > class TEST, typename T > | |
constexpr bool | test_type_exist () |
template<template< typename... > class TEST, typename T > | |
constexpr bool | test_type_value () |
template<template< typename... > class TEST, typename T > | |
constexpr bool | test_type () |
template<typename R , typename... PARAMS, typename... ARGS> | |
auto | TruncateCall (std::function< R(PARAMS...)> fun, ARGS &&...args) |
template<typename T > | |
std::size_t | Hash (const T &x) |
template<typename T > | |
std::size_t | CombineHash (const T &x) |
template<typename T1 , typename T2 , typename... EXTRA> | |
std::size_t | CombineHash (const T1 &x1, const T2 &x2, const EXTRA &...x_extra) |
template<typename Function > | |
function_traits< Function >::pointer | to_function_pointer (Function &lambda) |
template<typename Function > | |
function_traits< Function >::function | to_function (Function &lambda) |
template<typename RETURN , typename... FUN_ARGS, typename... CALL_ARGS> | |
auto | SubsetCall (std::function< RETURN(FUN_ARGS...)> fun, CALL_ARGS...args) -> RETURN |
Identify the number of parameters in a function and pass in correct number of argument. More... | |
template<typename T > | |
constexpr bool | is_ptr_type_v (const T &) |
void | Alert (const std::string &msg) |
template<typename... TYPE_SET> | |
static void | CappedAlert (size_t cap, TYPE_SET...inputs) |
A version of Alert that will cap how many times it can go off. More... | |
template<size_t NUM_BITS1, size_t NUM_BITS2> | |
BitSet< NUM_BITS1+NUM_BITS2 > | join (const BitSet< NUM_BITS1 > &in1, const BitSet< NUM_BITS2 > &in2) |
template<size_t NUM_BITS> | |
double | SimpleMatchCoeff (const BitSet< NUM_BITS > &in1, const BitSet< NUM_BITS > &in2) |
Computes simple matching coefficient (https://en.wikipedia.org/wiki/Simple_matching_coefficient). More... | |
template<int NUM_BITS> | |
constexpr uint32_t | UIntMaskFirst () |
Create a series of a specified number of ones (at compile time) in a uint. More... | |
template<> | |
constexpr uint32_t | UIntMaskFirst< 0 > () |
Create an empty bit mask (all zeros) More... | |
constexpr size_t | count_bits (uint64_t val) |
Count the number of bits in a 64-bit unsigned integer. More... | |
constexpr size_t | count_bits (uint32_t val) |
Count the number of bits in a 32-bit unsigned integer. More... | |
constexpr size_t | find_bit (const uint64_t &val) |
Return the position of the first one bit (in a 64-bit unsigned int) More... | |
constexpr size_t | find_bit (const uint32_t &val) |
Return the position of the first one bit (in a 32-bit unsigned int) More... | |
template<typename T > | |
constexpr T | MaxValue () |
Determine the maximum value for any type. More... | |
template<typename T > | |
constexpr double | InterpolateTable (T &&table, double pos, double tsize) |
The following function takes a table and a position [0.0, 1.0) and intepolates a value. More... | |
static void | Depricated (const std::string &name, const std::string &desc="") |
Depricated() prints its contents exactly once to notify a user of a depricated function. More... | |
static double | TimeFun (std::function< void()> test_fun) |
A function timer that takes a functor an identifies how long it takes to complete when run. More... | |
bool | Toggle (bool &in_bool) |
Toggle an input bool. More... | |
constexpr bool | AllTrue () |
Combine bools to AND them all together. More... | |
template<typename... Ts> | |
bool | AllTrue (bool result, Ts...OTHER) |
constexpr bool | AnyTrue () |
Combine bools to OR them all together. More... | |
template<typename... Ts> | |
bool | AnyTrue (bool result, Ts...OTHER) |
template<typename T > | |
static emp::vector< T > | BuildRange (T min, T max, T step=1) |
Build a vector with a range of values from min to max at the provided step size. More... | |
template<typename T , size_t N> | |
constexpr size_t | GetSize (T(&)[N]) |
Determine the size of a built-in array. More... | |
static size_t | UniqueVal () |
A function that will always return a unique value (and trip an assert if it can't...) More... | |
static std::string | UniqueName (const std::string &prefix="", const std::string &postfix="") |
Graph | shuffle_graph (const Graph &in_graph, Random &random) |
Graph | build_graph_ring (size_t v_count, Random &random) |
Construct a graph where all vertics are degree two and form a single ring. More... | |
Graph | build_graph_tree (size_t v_count, Random &random) |
Graph | build_graph_random (size_t v_count, size_t e_count, Random &random, bool connected=true) |
Graph | build_graph_grid (size_t width, size_t height, Random &random, double prob_use=1.0) |
Construct a graph with width x height vertices setup into a grid structure. More... | |
Graph | build_graph_clique_set (size_t clique_size, size_t clique_count, Random &random, double extra_prob=0.5) |
Graph | build_graph_dag (size_t v_count, size_t e_count, Random &random, bool connected=true) |
WeightedGraph | build_weighted_graph_tree (size_t v_count, size_t min_weight, size_t max_weight, Random &random) |
WeightedGraph | build_weighted_graph_random (size_t v_count, size_t e_count, size_t min_weight, size_t max_weight, Random &random, bool connected=true) |
Graph | load_graph_sym (std::istream &is, bool sub1=false) |
Graph | load_graph_sym (std::string filename, bool sub1=false) |
Load a graph with a specified filename. More... | |
Graph | load_graph_table (std::istream &is) |
Graph | load_graph_table (std::string filename) |
Load a graph from a connection matrix in a file by the specified name. More... | |
template<typename CONTAINER > | |
double | Entropy (const CONTAINER &weights) |
Convert a vector of weights to probabilities and return the entropy of the system. More... | |
template<typename CONTAINER , typename WEIGHT_FUN > | |
double | Entropy (const CONTAINER &objs, WEIGHT_FUN fun, double total=0.0) |
constexpr double | Entropy2 (const double p) |
Calculate the entropy when their are two possibile states based on one state's probability. More... | |
template<typename CONTAINER , typename CAT_FUN_X , typename CAT_FUN_Y , typename WEIGHT_FUN > | |
double | Entropy (const CONTAINER &objs, CAT_FUN_X funX, CAT_FUN_Y funY, WEIGHT_FUN funW) |
static const DFA & | to_DFA (const DFA &dfa) |
Converting DFA to DFA – no change needed. More... | |
static const NFA & | to_NFA (const NFA &nfa) |
Converting NFA to MFA – no change needed. More... | |
static DFA | to_DFA (const NFA &nfa, int keep_invalid=false) |
Systematic conversion of NFA to DFA... More... | |
static NFA | to_NFA (const DFA &dfa) |
Systematic up-conversion of DFA to NFA... More... | |
template<typename T1 > | |
static NFA | MergeNFA (T1 &&in) |
Merge multiple automata into one NFA (base case, single converstion) More... | |
template<typename T1 , typename T2 , typename... Ts> | |
static NFA | MergeNFA (T1 &&in1, T2 &&in2, Ts &&...others) |
Merge multiple automata (DFA, NFA, RegEx) into one NFA. More... | |
template<typename T1 , typename T2 , typename... Ts> | |
static DFA | MergeDFA (T1 &&in1, T2 &&in2, Ts &&...others) |
Merge multiple automata (DFA, NFA, RegEx) into one DFA. More... | |
std::string | FindExample (const DFA &dfa, const size_t min_size=1) |
Method to find an example string that satisfies a DFA. More... | |
template<class MAP_T , class KEY_T > | |
bool | Has (const MAP_T &in_map, const KEY_T &key) |
Take any map type, and run find to determine if a key is present. More... | |
template<class MAP_T , class KEY_T > | |
auto | Find (const MAP_T &in_map, const KEY_T &key, const typename MAP_T::mapped_type &dval) |
template<class MAP_T , class KEY_T > | |
const auto & | FindRef (const MAP_T &in_map, const KEY_T &key, const typename MAP_T::mapped_type &dval) |
template<typename A , typename B > | |
constexpr std::pair< B, A > | flip_pair (const std::pair< A, B > &p) |
Take an std::pair<A,B> and return the flipped pair std::pair<B,A> More... | |
template<typename A , typename B > | |
std::multimap< B, A > | flip_map (const std::map< A, B > &src) |
Take an std::map<A,B> and return the flipped map (now multimap to be safe): std::multimap<B,A> More... | |
constexpr int | Mod (int in_val, int mod_val) |
% is actually remainder; Mod is a proper modulus command that handles negative #'s correctly More... | |
double | Mod (double in_val, double mod_val) |
Regular Mod doesn't work on doubles. Build one that does! More... | |
template<typename T > | |
constexpr T | Abs (T in) |
Find the absolute value for any variable. More... | |
template<typename TYPE > | |
constexpr TYPE | ToRange (const TYPE &value, const TYPE &in_min, const TYPE &in_max) |
Run both min and max on a value to put it into a desired range. More... | |
template<typename T > | |
constexpr T | Min (T in1) |
Min of only one element is that element itself! More... | |
template<typename T , typename... Ts> | |
constexpr T | Min (T in1, T in2, Ts...extras) |
Min of multiple elements is solved recursively. More... | |
template<typename T > | |
constexpr T | Max (T in1) |
Max of only one element is that element itself! More... | |
template<typename T , typename... Ts> | |
constexpr T | Max (T in1, T in2, Ts...extras) |
Max of multiple elements is solved recursively. More... | |
template<typename T > | |
constexpr const T & | MinRef (const T &in1) |
template<typename T , typename... Ts> | |
constexpr const T & | MinRef (const T &in1, const T &in2, const Ts &...extras) |
MinRef of multiple elements returns reference to minimum value. More... | |
template<typename T > | |
constexpr const T & | MaxRef (const T &in1) |
template<typename T , typename... Ts> | |
constexpr const T & | MaxRef (const T &in1, const T &in2, const Ts &...extras) |
MaxRef of multiple elements returns reference to maximum value. More... | |
static constexpr double | Log2 (double x) |
Compile-time log base 2 calculator. More... | |
static constexpr double | Log (double x, double base=10.0) |
Compile-time log calculator. More... | |
static constexpr double | Ln (double x) |
Compile-time natural log calculator. More... | |
static constexpr double | Log10 (double x) |
Compile-time log base 10 calculator. More... | |
template<typename T > | |
static constexpr T | Square (T val) |
A simple function to square a value. More... | |
template<typename T > | |
static constexpr type_if< T, std::is_integral > | Pow (T base, T p) |
A fast (O(log p)) integral-power command. More... | |
static constexpr double | Pow2 (double exp) |
A fast 2^x command. More... | |
template<typename TYPE > | |
static constexpr TYPE | IntPow (TYPE base, TYPE exp) |
A fast method for calculating exponents for int types. More... | |
static constexpr double | Pow (double base, double exp) |
A fast method for calculating exponents on doubles. More... | |
static constexpr double | Exp (double exp) |
A fast method of calculating e^x. More... | |
template<typename TYPE > | |
static constexpr int | IntLog2 (TYPE x) |
A compile-time int-log calculator (aka, significant bits) More... | |
template<typename TYPE > | |
static constexpr int | CountOnes (TYPE x) |
A compile-time bit counter. More... | |
template<typename TYPE > | |
static constexpr TYPE | MaskLow (std::size_t num_bits) |
Quick bit-mask generator for low bits. More... | |
template<typename TYPE > | |
static constexpr TYPE | MaskHigh (std::size_t num_bits) |
Quick bit-mask generator for high bits. More... | |
template<typename T > | |
constexpr const T & | Min (const T &in1, const T &in2, const T &in3) |
Return the minimum of three values. More... | |
template<typename T > | |
const T & | Min (std::initializer_list< const T & > lst) |
A version of Min that allows a variable number of inputs to be compared. More... | |
template<typename T > | |
const T & | Max (std::initializer_list< const T & > lst) |
A version of Max that allows a variable number of inputs to be compared. More... | |
template<typename T > | |
void | Shuffle (Random &random, emp::vector< T > &v, size_t max_count) |
template<typename T > | |
void | Shuffle (Random &random, emp::vector< T > &v) |
emp::vector< size_t > | GetPermutation (Random &random, size_t size) |
Return an emp::vector<int> numbered 0 through size-1 in a random order. More... | |
void | Choose (Random &random, size_t N, size_t K, std::vector< size_t > &choices) |
Choose K positions from N possibilities. More... | |
std::vector< size_t > | Choose (Random &random, size_t N, size_t K) |
BitVector | RandomBitVector (Random &random, size_t size, double p=0.5) |
Generate a random BitVector of the specified size. More... | |
emp::vector< double > | RandomDoubleVector (Random &random, size_t size, double min, double max) |
Generate a random double vector in the specified range. More... | |
emp::vector< size_t > | RandomUIntVector (Random &random, size_t size, size_t min, size_t max) |
Generate a random size_t vector in the specified range. More... | |
template<typename T > | |
emp::vector< T > | RandomVector (Random &random, size_t size, T min, T max) |
Generate a random vector in the specified type and range. More... | |
void | RandomizeBitVector (BitVector &bits, Random &random, double p=0.5) |
Generate a random BitVector of the specified size. More... | |
template<typename T > | |
void | RandomizeVector (emp::vector< T > &vals, Random &random, T min, T max) |
Generate a random vector in the specified type and range. More... | |
template<typename T > | |
Range< T > | MakeRange (T _l, T _u) |
Build a new range with auto-detected type. More... | |
Range< int > | IntRange (int _l, int _u) |
Build a new range of type int. More... | |
Range< double > | DRange (double _l, double _u) |
Build a new range of type double. More... | |
static NFA | to_NFA (const RegEx ®ex, size_t stop_id=1) |
Simple conversion of RegEx to NFA (mostly implemented in RegEx) More... | |
static DFA | to_DFA (const RegEx ®ex) |
Conversion of RegEx to DFA, via NFA intermediate. More... | |
template<typename TYPE > | |
size_t | calc_hamming_distance (const TYPE &in1, const TYPE &in2, int offset=0) |
template<typename TYPE > | |
size_t | calc_edit_distance (const TYPE &in1, const TYPE &in2) |
template<typename TYPE , typename GAP_TYPE > | |
size_t | align (TYPE &in1, TYPE &in2, GAP_TYPE gap) |
template<typename T > | |
void | insert (std::set< T > &s1, const std::set< T > &s2) |
Insert the full contents of s2 into s1. More... | |
template<typename T , typename H > | |
bool | Has (const std::set< T, H > &s, const T &val) |
Test if an std::set has a particular element without modifying the set in any way. More... | |
template<typename T , typename H > | |
bool | Has (const std::multiset< T, H > &s, const T &val) |
Test if an std::multiset has a particular element without modifying the set in any way. More... | |
template<typename T , typename H > | |
bool | Has (const std::unordered_set< T, H > &s, const T &val) |
Test if an std::unordered_set has a particular element without modifying the set in any way. More... | |
template<typename T , typename H > | |
bool | Has (const std::unordered_multiset< T, H > &s, const T &val) |
Test if an std::unordere_multiset has a particular element without modifying the set in any way. More... | |
template<typename T > | |
std::set< T > | difference (std::set< T > &s1, std::set< T > &s2) |
Compute the set difference of. More... | |
template<typename T > | |
std::set< T > | difference (emp::vector< T > s1, emp::vector< T > &s2) |
Compute the set difference of. More... | |
template<typename T > | |
std::set< T > | difference (std::set< T > &s1, emp::vector< T > s2) |
Compute the set difference of. More... | |
template<typename T > | |
std::set< T > | difference (emp::vector< T > s1, std::set< T > &s2) |
Compute the set difference of. More... | |
template<typename T > | |
std::set< T > | intersection (std::set< T > s1, std::set< T > s2) |
Compute the set intersection of. More... | |
template<typename T > | |
std::set< T > | intersection (emp::vector< T > s1, emp::vector< T > s2) |
Compute the set intersection of. More... | |
template<typename T > | |
std::set< T > | intersection (std::set< T > s1, emp::vector< T > s2) |
Compute the set intersection of. More... | |
template<typename T > | |
std::set< T > | intersection (emp::vector< T > s1, std::set< T > s2) |
Compute the set intersection of. More... | |
template<typename T > | |
std::set< T > | set_union (std::set< T > s1, std::set< T > s2) |
Compute the set union of. More... | |
template<typename T > | |
std::set< T > | set_union (emp::vector< T > s1, emp::vector< T > s2) |
Compute the set union of. More... | |
template<typename T > | |
std::set< T > | set_union (std::set< T > s1, emp::vector< T > s2) |
Compute the set union of. More... | |
template<typename T > | |
std::set< T > | set_union (emp::vector< T > s1, std::set< T > s2) |
Compute the set union of. More... | |
template<typename T > | |
std::set< T > | symmetric_difference (std::set< T > s1, std::set< T > s2) |
Compute the set symmetric_difference of. More... | |
template<typename T > | |
std::set< T > | symmetric_difference (emp::vector< T > s1, emp::vector< T > s2) |
Compute the set symmetric_difference of. More... | |
template<typename T > | |
std::set< T > | symmetric_difference (std::set< T > s1, emp::vector< T > s2) |
Compute the set symmetric_difference of. More... | |
template<typename T > | |
std::set< T > | symmetric_difference (emp::vector< T > s1, std::set< T > s2) |
Compute the set symmetric_difference of. More... | |
template<typename C > | |
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename C::value_type >::value, typename C::value_type >::type | Sum (C &elements) |
template<typename C > | |
std::enable_if< emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename emp::remove_ptr_type< typename C::value_type >::type >::value, typename emp::remove_ptr_type< typename C::value_type >::type >::type | Sum (C &elements) |
template<typename C > | |
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value, double >::type | ShannonEntropy (C &elements) |
Calculate Shannon Entropy of the members of the container passed. More... | |
template<typename C > | |
std::enable_if< emp::is_ptr_type< typename C::value_type >::value, double >::type | ShannonEntropy (C &elements) |
Calculate Shannon Entropy of the members of the container when those members are pointers. More... | |
template<typename C > | |
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename C::value_type >::value, double >::type | Variance (C &elements) |
template<typename C > | |
std::enable_if< emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename emp::remove_ptr_type< typename C::value_type >::type >::value, double >::type | Variance (C &elements) |
template<typename C > | |
emp::sfinae_decoy< double, typename C::value_type > | Mean (C &elements) |
template<typename C > | |
emp::sfinae_decoy< double, typename C::value_type > | StandardDeviation (C &elements) |
template<typename C > | |
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value, int >::type | UniqueCount (C &elements) |
Count the number of unique elements in a container. More... | |
template<typename C > | |
std::enable_if< emp::is_ptr_type< typename C::value_type >::value, int >::type | UniqueCount (C &elements) |
template<typename C , typename RET_TYPE , typename ARG_TYPE > | |
RET_TYPE | MaxResult (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements) |
Run the provided function on every member of a container and return the MAXIMUM result. More... | |
template<typename C , typename RET_TYPE , typename ARG_TYPE > | |
RET_TYPE | MinResult (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements) |
Run the provided function on every member of a container and return the MINIMUM result. More... | |
template<typename C , typename RET_TYPE , typename ARG_TYPE > | |
std::enable_if< std::is_scalar< RET_TYPE >::value, double >::type | MeanResult (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements) |
template<typename C , typename RET_TYPE , typename ARG_TYPE > | |
emp::vector< RET_TYPE > | ApplyFunction (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements) |
Run the provided function on every member of a container and return a vector of ALL results. More... | |
static const std::string & | empty_string () |
static std::string | to_escaped_string (char value) |
Convert a single chararcter to one that uses a proper escape sequence (in a string) if needed. More... | |
static std::string | to_escaped_string (const std::string &value) |
Convert a full string to one that uses proper escape sequences, as needed. More... | |
template<typename LIT_TYPE > | |
std::string | to_literal (const LIT_TYPE &value) |
Take a value and convert it to a C++-style literal. More... | |
static std::string | to_literal (char value) |
Take a char and convert it to a C++-style literal. More... | |
static std::string | to_literal (const std::string &value) |
Take a string and convert it to a C++-style literal. More... | |
static std::string | to_upper (std::string value) |
Convert a string to all uppercase. More... | |
static std::string | to_lower (std::string value) |
Convert a string to all lowercase. More... | |
static std::string | to_roman_numeral (int val, const std::string &prefix="") |
bool | is_whitespace (char test_char) |
Determine if a character is whitespace. More... | |
bool | is_upper_letter (char test_char) |
Determine if a character is an uppercase letter. More... | |
bool | is_lower_letter (char test_char) |
Determine if a character is a lowercase letter. More... | |
bool | is_letter (char test_char) |
Determine if a character is a letter of any kind. More... | |
bool | is_digit (char test_char) |
Determine if a character is a digit. More... | |
bool | is_alphanumeric (char test_char) |
Determine if a character is a letter or digit. More... | |
bool | is_idchar (char test_char) |
Determine if a character is a letter, digit, or underscore. More... | |
static bool | is_one_of (char test_char, const std::string &char_set) |
Determine if a character is in a set of characters (represented as a string) More... | |
static bool | is_composed_of (const std::string &test_str, const std::string &char_set) |
Determine if a string is composed only of a set of characters (represented as a string) More... | |
bool | has_whitespace (const std::string &test_str) |
Determine if there is whitespace anywhere in a string. More... | |
bool | has_upper_letter (const std::string &test_str) |
Determine if there are any uppercase letters in a string. More... | |
bool | has_lower_letter (const std::string &test_str) |
Determine if there are any lowercase letters in a string. More... | |
bool | has_letter (const std::string &test_str) |
Determine if there are any letters in a string. More... | |
bool | has_digit (const std::string &test_str) |
Determine if there are any digits in a string. More... | |
bool | has_alphanumeric (const std::string &test_str) |
Determine if there are any letters or digits anywhere in a string. More... | |
bool | has_idchar (const std::string &test_str) |
Determine if there are any letters, digit, or underscores anywhere in a string. More... | |
static bool | has_one_of (const std::string &test_str, const std::string &char_set) |
Determine if a specified set of characters appears anywhere in a string. More... | |
bool | is_valid (char test_char) |
If no functions are provided to is_valid(), always return false as base case. More... | |
template<typename... FUNS> | |
bool | is_valid (char test_char, std::function< bool(char)> fun1, FUNS...funs) |
Determine if a character passes any of the test functions provided. More... | |
template<typename... FUNS> | |
static bool | is_valid (const std::string &test_str, FUNS...funs) |
For a string to be valid, each character must pass at least one provided function. More... | |
static std::string | string_pop_fixed (std::string &in_string, std::size_t end_pos, size_t delim_size=0) |
Pop a segment from the beginning of a string as another string, shortening original. More... | |
static std::string | string_get_range (const std::string &in_string, std::size_t start_pos, std::size_t end_pos) |
Get a segment from the beginning of a string as another string, leaving original untouched. More... | |
std::string | string_pop (std::string &in_string, const char delim=' ') |
std::string | string_get (const std::string &in_string, const char delim, size_t start_pos=0) |
std::string | string_pop (std::string &in_string, const std::string &delim_set) |
std::string | string_get (const std::string &in_string, const std::string &delim_set, size_t start_pos=0) |
std::string | string_pop_word (std::string &in_string) |
Remove a prefix of a string, up to the first whitespace, and return it. More... | |
std::string | string_get_word (const std::string &in_string, size_t start_pos=0) |
Return a prefix of a string, up to the first whitespace (do not modify the original string) More... | |
std::string | string_pop_line (std::string &in_string) |
Remove a prefix of a string, up to the first newline, and return it. More... | |
std::string | string_get_line (const std::string &in_string, size_t start_pos=0) |
Return a prefix of a string, up to the first newline (do not modify the original string) More... | |
std::string | left_justify (std::string &in_string) |
Remove all whitespace at the beginning of a string. Return the whitespace removed. More... | |
void | right_justify (std::string &in_string) |
Remove all whitespace at the end of a string. More... | |
static void | remove_chars (std::string &in_string, std::string chars) |
Remove instances of characters from file. More... | |
static void | compress_whitespace (std::string &in_string) |
Every time one or more whitespace characters appear replace them with a single space. More... | |
static void | remove_whitespace (std::string &in_string) |
Remove all whitespace from anywhere within a string. More... | |
static void | remove_punctuation (std::string &in_string) |
Remove all characters from a string except letters, numbers, and whitespace. More... | |
static void | slice (const std::string &in_string, emp::vector< std::string > &out_set, char delim='\n') |
Cut up a string based on the provided delimitor; fill them in to the provided vector. More... | |
static emp::vector< std::string > | slice (const std::string &in_string, char delim='\n') |
Slice a string without passing in result vector (may be less efficient). More... | |
template<typename... ALL_TYPES> | |
std::string | to_string (ALL_TYPES &&...all_values) |
template<typename T > | |
T | from_string (const std::string &str) |
template<typename... Ts> | |
void | from_string (const std::string &str, Ts &...args) |
The from_string() function can also take multiple args instead of a return. More... | |
template<typename T > | |
emp::vector< T > | from_strings (const emp::vector< std::string > &string_v) |
template<typename TUPLE_T > | |
constexpr int | tuple_size () |
Quick way to calculate tuple size. More... | |
template<typename... Ts, int... Ps> | |
auto | shuffle_tuple (const std::tuple< Ts... > &tup, IntPack< Ps... >) |
Reorganize the entries in tuple; the provided int pack must specify the new ordering. More... | |
template<typename FUN_T , typename TUPLE_T , int... N> | |
auto | ApplyTuple (const FUN_T &fun, const TUPLE_T &tup, IntPack< N... >) |
template<typename FUN_T , typename TUPLE_T > | |
auto | ApplyTuple (const FUN_T &fun, const TUPLE_T &tup) |
Apply a tuple as arguments to a function, in order. More... | |
template<typename T > | |
int | FindValue (const emp::vector< T > vec, const T &val, size_t start_pos=0) |
Return the first position of a value in a vector (or -1 if none exists) More... | |
template<typename T > | |
bool | Has (const emp::vector< T > vec, const T &val) |
Return whether a value exists in a vector.s. More... | |
template<typename T > | |
void | Print (const emp::vector< T > &v, std::ostream &os=std::cout, const std::string &spacer=" ") |
Print the contects of a vector. More... | |
template<typename T > | |
size_t | FindIndex (const T &v, const std::function< bool(typename T::value_type, typename T::value_type)> &fun) |
template<typename T > | |
size_t | FindMinIndex (const T &v) |
Find the index with the minimal value (picks first in cases of a tie). More... | |
template<typename T > | |
size_t | FindMaxIndex (const T &v) |
Find the index with the maximal value (picks first in cases of a tie). More... | |
template<typename T > | |
T | Sum (const emp::vector< T > &v) |
Sum up the contents of a vector. More... | |
template<typename T > | |
T | Product (const emp::vector< T > &v) |
Multiply all of the contents of a vector. More... | |
template<typename T , typename... Ts> | |
void | Sort (emp::vector< T > &v, Ts...args) |
A quick shortcut for sorting a vector. More... | |
template<typename T > | |
emp::vector< T > | Slice (emp::vector< T > vec, int start, int stop) |
constexpr size_t | tree_left (size_t id) |
Tree manipulation in vectors. More... | |
constexpr size_t | tree_right (size_t id) |
constexpr size_t | tree_parent (size_t id) |
template<typename T > | |
bool | Heapify (emp::vector< T > &v, size_t id) |
Heapify an individual node in a vector. More... | |
template<typename T > | |
void | Heapify (emp::vector< T > &v) |
Heapify all elements in a vector. More... | |
template<typename T > | |
T | HeapExtract (emp::vector< T > &v) |
Extraxt maximum element from a heap. More... | |
template<typename T > | |
void | HeapInsert (emp::vector< T > &v, T val) |
Insert a new element into a heap. More... | |
std::string | ColorHSL (double h, double s, double l) |
Generate a string to describe a JS color out of HSL values. More... | |
std::string | ColorRGB (int r, int g, int b) |
Generate a string to describe a JS color out of RGB values. More... | |
std::string | ColorRGB (int r, int g, int b, double a) |
Generate a string to describe a JS color with an alpha channel. More... | |
const emp::vector< std::string > & | GetHueMap (size_t map_size, double min_h=0.0, double max_h=360.0, int s=100, int l=50) |
emp::vector< std::string > | GetHSLMap (size_t map_size, double min_h=0.0, double max_h=360.0, int min_s=100, int max_s=100, int min_l=50, int max_l=50) |
Generate a vector of color strings providing ranges of all of hue, satuation and luminosity. More... | |
static void | DelayCall (const std::function< void()> &in_fun, int delay) |
Call a function after a specified amount of time. More... | |
static void | OnResize (const std::function< void()> &in_fun) |
Provide a function to call whenever a window's size changes (no arguments). More... | |
static void | OnResize (const std::function< void(int, int)> &in_fun) |
Provide a function to call whenever a window's size changes (new size as arguments) More... | |
double | GetTime () |
Get the current time, as provided by the web browser. More... | |
int | GetWindowInnerWidth () |
Determine with width of the current window. More... | |
int | GetWindowInnerHeight () |
Determine with height of the current window. More... | |
static void | SetBackgroundColor (const std::string color) |
Set the background color of this web page. More... | |
static void | SetColor (const std::string color) |
static void | SetCursor (const char *type) |
static void | OpenWindow (const std::string &url) |
static std::string | text2html (const std::string &text) |
std::ofstream | debug_file ("debug_file") |
static bool | Initialize () |
Stub for when Emscripten is not in use. More... | |
static bool | InitializeAnim () |
Stub for when Emscripten is not in use. More... | |
std::map< std::string, std::string > | get_type_to_string_map () |
template<typename C , class = typename C::value_type> | |
void | pass_array_to_javascript (C values) |
template<std::size_t SIZE, typename T > | |
void | pass_array_to_cpp (emp::array< T, SIZE > &arr, bool recurse=false) |
template<typename T > | |
void | pass_vector_to_cpp (emp::vector< T > &arr, bool recurse=false) |
Same as pass_array_to_cpp, but lets you store values in a vector instead. More... | |
Variables | |
constexpr const int32_t | sin_chart_1K [] |
constexpr const int32_t | cos_chart_1K [] |
constexpr const int32_t | tan_chart_1K [] |
template<typename Needle , typename Haystack , template< typename, typename > class... Cmp> | |
constexpr bool | variadic_contains_v |
template<typename Needle , typename Haystack , template< typename, typename > class... Cmp> | |
static constexpr auto | variadic_index_of_v |
constexpr size_t | ByteCount [256] |
How many bits are set to one in each possible byte? More... | |
constexpr const double | E = 2.71828 |
e More... | |
constexpr const double | PHI = 1.61803398874 |
Golden ratio. More... | |
constexpr const double | PI = 3.14159265358979 |
pi More... | |
constexpr const double | SQRT2 = 1.41421356237310 |
sqrt(2) More... | |
constexpr const uint32_t | MAX_BYTE = 255 |
(2^8 - 1) More... | |
constexpr const uint32_t | MAX_2BYTE = 65535 |
(2^16 - 1) More... | |
constexpr const uint32_t | MAX_WORD = 65535 |
(2^16 - 1) More... | |
constexpr const uint32_t | MAX_3BYTE = 16777215 |
(2^24 - 1) More... | |
constexpr const uint32_t | MAX_UINT = 4294967295 |
(2^32 - 1) More... | |
constexpr const uint32_t | MAX_4BYTE = 4294967295 |
(2^32 - 1) More... | |
constexpr const int32_t | MIN_INT = -2147483648 |
(- 2^31) More... | |
constexpr const double | log2_chart_1_2 [] |
Large table to log base-2 results. More... | |
constexpr const double | pow2_chart_bits [] |
Table to provide results of Pow2 for values of bits (0.1, 0.01, 0.001, etc, in binary) More... | |
constexpr const double | pow2_chart_0_1 [] |
Table to provide results of Pow2 from 0 to 1. More... | |
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
This file contains functions for adding additional data files to Worlds.
using emp::AdaptTemplate = typedef typename internal::AdaptTemplateHelper<T, U...>::type |
using emp::AdaptTemplate_Arg1 = typedef typename internal::AdaptTemplateHelper_Arg1<T, U>::type |
using emp::BatchConfig = typedef BatchConfig<RUN_T, RUN_T::config_t> |
using emp::bool_decoy = typedef bool |
using emp::Circle = typedef Circle2D<double> |
using emp::DataArchive = typedef DataNode<T, data::Info, data::Archive, data::FullRange, MODS...> |
A node that stores all data it recieves in an archive (vector of vectors). The inner vectors are groups of data that were recieved between resets. This node also keeps a record of the min, max, count, and total of each vector, so you don't have to recalculate it later. Additionally, it allows you to give it a name, description, and keyword.
using emp::DataLog = typedef DataNode<T, data::Current, data::Info, data::Log, MODS...> |
A node that stores data about the most recent value it recieved, as well as all values it has recieved since the last reset. It also allows you to give it a name, description, and keyword.
using emp::DataMonitor = typedef DataNode<T, data::Current, data::Info, data::Range, data::Stats, MODS...> |
A node that stores data about the most recent value it recieved, as well as the distribution (min, max, count, total, and mean) of values it has recieved since the last reset. It also allows you to give it a name, description, and keyword.
Setup DFA to be a simple tDFA with the basic character set for symbols.
using emp::EventDrivenGP = typedef EventDrivenGP_AW<8> |
A convenient shortcut for using EventDrivenGP_AW class with affinity width set to a default of 8.
using emp::find_genome_t = typedef decltype( Org2Genome<ORG>(true) ) |
using emp::first_type = typedef T1 |
using emp::int_decoy = typedef int |
using emp::IntPackRange = typedef typename internal::ip_range<(START >= END), START, END, STEP>::type |
using emp::last_type = typedef pack_id<sizeof...(Ts)-1,Ts...> |
using emp::ModPack = typedef emp::IntPack<(int) MODS...> |
A shortcut for converting DataNode mod ID's to IntPacks.
using emp::NFA_State = typedef tNFA_State<128, uint8_t> |
NFA_State is the most standard tNFA_State setup.
using emp::Othello = typedef Othello_Game<8> |
using emp::pack_id = typedef typename internal::pack_id_impl<ID,Ts...>::type |
using emp::Point = typedef Point2D<> |
using emp::remove_ptr_type_t = typedef typename remove_ptr_type<T>::type |
using emp::second_type = typedef T2 |
using emp::sfinae_decoy = typedef REAL_TYPE |
using emp::third_type = typedef T3 |
using emp::type_decoy = typedef REAL_TYPE |
using emp::type_if = typedef typename internal::EMP_eval_type< T, FILTER<T>::value >::type |
A template for making a type exist if and only if it passes a template test. For example: type_if<T, std::is_integral> This becomes T if the type is integral; it's undefined otherwise.
using emp::TypePackFill = typedef typename tp_pad<TypePack<>,T,N>::type |
using emp::variadic_concat_t = typedef typename variadic_concat<Variadics...>::type |
using emp::variadic_filter_t = typedef typename variadic_filter<Variadic, Filter>::type |
using emp::variadic_intersection_t = typedef typename variadic_intersection<Cmp, U...>::type |
using emp::variadic_remove_duplicates_t = typedef typename variadic_remove_duplicates<Variadic, Cmp...>::type |
using emp::variadic_union_t = typedef typename variadic_union<Cmp, U...>::type |
|
strong |
A set of modifiers are available do describe DataNode.
Enumerator | |
---|---|
Current |
Track most recent value. |
Info |
Include information (name, keyword, description) for each instance. |
Log |
Track all values since last Reset() |
Archive |
Track Log + ALL values over time (with purge options) |
Range |
Track min, max, mean, total. |
FullRange |
Track Range data over time. |
Histogram |
Keep a full histogram. |
Stats |
Track Range + variance, standard deviation, skew, kertosis. |
Pull |
Enable data collection on request. Various signals are possible: |
SignalReset |
Include a signal that triggers BEFORE Reset() to process data. |
SignalData |
Include a signal when new data is added (as a group) |
SignalDatum |
Include a signal when each datum is added. |
SignalRange |
Include a signal for data in a range. |
SignalLimits |
Include a signal for data OUTSIDE a range. |
UNKNOWN |
Unknown modifier; will trigger error. |
|
strong |
|
strong |
constexpr T emp::Abs | ( | T | in | ) |
Find the absolute value for any variable.
DataFile& emp::AddLineageMutationFile | ( | WORLD_TYPE & | world, |
int | systematics_id = 0 , |
||
const std::string & | fpath = "lineage_mutations.csv" , |
||
emp::vector< std::string > | mut_types = {"substitution"} |
||
) |
DataFile& emp::AddPhylodiversityFile | ( | WORLD_TYPE & | world, |
int | systematics_id = 0 , |
||
const std::string & | fpath = "phylodiversity.csv" |
||
) |
void emp::Alert | ( | const std::string & | msg | ) |
Send msg to cerr if in C++, or show msg in an alert box if compiled to Javascript Input can be any number of arguments of any types as long as the can be converted to strings with emp::to_string().
size_t emp::align | ( | TYPE & | in1, |
TYPE & | in2, | ||
GAP_TYPE | gap | ||
) |
Use edit distance to find the minimum number of insertions, deletions and substitutions to convert one array to another, and then insert gaps into the arrays appropriately.
|
inline |
Combine bools to AND them all together.
|
inline |
|
inline |
Combine bools to OR them all together.
|
inline |
emp::vector<RET_TYPE> emp::ApplyFunction | ( | std::function< RET_TYPE(ARG_TYPE)> & | fun, |
C & | elements | ||
) |
Run the provided function on every member of a container and return a vector of ALL results.
auto emp::ApplyTuple | ( | const FUN_T & | fun, |
const TUPLE_T & | tup, | ||
IntPack< N... > | |||
) |
Apply a tuple as arguments to a function, where all argument positions in function are specified with and IntPack
auto emp::ApplyTuple | ( | const FUN_T & | fun, |
const TUPLE_T & | tup | ||
) |
Apply a tuple as arguments to a function, in order.
Graph emp::build_graph_clique_set | ( | size_t | clique_size, |
size_t | clique_count, | ||
Random & | random, | ||
double | extra_prob = 0.5 |
||
) |
Build a set of cliques (such that one member of each can be part of an independent set) and then links them together
Graph emp::build_graph_dag | ( | size_t | v_count, |
size_t | e_count, | ||
Random & | random, | ||
bool | connected = true |
||
) |
Construct a random, graph with the specified number of vertices and edges. If connected is set, start by building a tree. Then connect random (unconnected) pairs of vertices until the proper number of edges are included.
Construct a graph with width x height vertices setup into a grid structure.
Graph emp::build_graph_random | ( | size_t | v_count, |
size_t | e_count, | ||
Random & | random, | ||
bool | connected = true |
||
) |
Construct a random, graph with the specified number of vertices and edges. If connected is set, start by building a tree. Then connect random (unconnected) pairs of vertices until the proper number of edges are included.
Construct a graph where all vertics are degree two and form a single ring.
Construct a random tree graph (new vertices are repeatedly attached to a random position in a treee as it is constructed.)
WeightedGraph emp::build_weighted_graph_random | ( | size_t | v_count, |
size_t | e_count, | ||
size_t | min_weight, | ||
size_t | max_weight, | ||
Random & | random, | ||
bool | connected = true |
||
) |
Construct a random, WEIGHTED graph with the specified number of vertices, edges, and range of edge weights. If connected is set, start by building a tree. Then connect random (unconnected) pairs of vertices until the proper number of edges are included.
WeightedGraph emp::build_weighted_graph_tree | ( | size_t | v_count, |
size_t | min_weight, | ||
size_t | max_weight, | ||
Random & | random | ||
) |
Construct a random WEIGHTED tree graph (new vertices are repeatedly attached to a random position in a treee as it is constructed.)
|
inlinestatic |
Build a vector with a range of values from min to max at the provided step size.
size_t emp::calc_edit_distance | ( | const TYPE & | in1, |
const TYPE & | in2 | ||
) |
Edit distance is the minimum number of insertions, deletions and substitutions to convert one array to another.
size_t emp::calc_hamming_distance | ( | const TYPE & | in1, |
const TYPE & | in2, | ||
int | offset = 0 |
||
) |
Hamming distance is a simple count of substitutions needed to convert one array to another.
in1 | The first sequence to compare. |
in2 | The second sequence to compare. |
offset | (optional) Position in the first sequence to start the second sequence. |
|
static |
A version of Alert that will cap how many times it can go off.
|
inline |
Choose K positions from N possibilities.
|
inline |
|
inline |
Remove all waiting exceptions of the desginated type.
|
inline |
Remove all waiting exceptions.
emp::vector<Ptr<T> > emp::ClonePtrs | ( | const emp::vector< Ptr< T >> & | in | ) |
Copy a vector of objects pointed to by using their Clone() member function; return vector.
std::string emp::ColorHSL | ( | double | h, |
double | s, | ||
double | l | ||
) |
Generate a string to describe a JS color out of HSL values.
std::string emp::ColorRGB | ( | int | r, |
int | g, | ||
int | b | ||
) |
Generate a string to describe a JS color out of RGB values.
std::string emp::ColorRGB | ( | int | r, |
int | g, | ||
int | b, | ||
double | a | ||
) |
Generate a string to describe a JS color with an alpha channel.
std::size_t emp::CombineHash | ( | const T & | x | ) |
std::size_t emp::CombineHash | ( | const T1 & | x1, |
const T2 & | x2, | ||
const EXTRA &... | x_extra | ||
) |
|
inlinestatic |
Every time one or more whitespace characters appear replace them with a single space.
Copy an object pointed to and return a Ptr to the copy.
emp::vector<Ptr<T> > emp::CopyPtrs | ( | const emp::vector< Ptr< T >> & | in | ) |
Copy a vector of objects pointed to; return a vector of Ptrs to the new copies.
|
inline |
Count the number of bits in a 64-bit unsigned integer.
|
inline |
Count the number of bits in a 32-bit unsigned integer.
constexpr size_t emp::count_type | ( | ) |
constexpr size_t emp::count_type | ( | ) |
int emp::CountDeleteriousSteps | ( | Ptr< taxon_t > | taxon | ) |
Returns the total number of deleterious mutational steps that occurred along
taxon | 's lineage. (a change from parent to child taxon counts as a single step, regardless of the number of mutations that happened at that time point) |
|
inline |
How many exceptions are waiting to be dealt with?
int emp::CountMuts | ( | Ptr< taxon_t > | taxon, |
std::string | type = "substitution" |
||
) |
Returns the total number of mutations of type
type | that occurred along |
taxon | 's lineage. |
int emp::CountMuts | ( | Ptr< taxon_t > | taxon, |
emp::vector< std::string > | types | ||
) |
Returns the total number of mutations of type
type | that occurred along |
taxon | 's lineage. |
int emp::CountMutSteps | ( | Ptr< taxon_t > | taxon, |
std::string | type = "substitution" |
||
) |
Returns the total number of times a mutation of type
type | that along |
taxon | 's lineage. (Different from CountMuts in that CountMuts sums them whereas CountMutSteps would count two simultaneous mutations of the same type as one event) |
int emp::CountMutSteps | ( | Ptr< taxon_t > | taxon, |
emp::vector< std::string > | types | ||
) |
Returns the total number of times a mutation of type
type | that along |
taxon | 's lineage. (Different from CountMuts in that CountMuts sums them whereas CountMutSteps would count two simultaneous mutations of the same type as one event) |
|
static |
A compile-time bit counter.
int emp::CountPhenotypeChanges | ( | Ptr< taxon_t > | taxon | ) |
Returns the total number of changes in phenotype that occurred along
taxon | 's lineage. |
int emp::CountUniquePhenotypes | ( | Ptr< taxon_t > | taxon | ) |
Returns the total number of unique phenotypes that occurred along
taxon | 's lineage. |
std::ofstream emp::debug_file | ( | "debug_file" | ) |
|
static |
Call a function after a specified amount of time.
|
static |
Depricated() prints its contents exactly once to notify a user of a depricated function.
std::set<T> emp::difference | ( | std::set< T > & | s1, |
std::set< T > & | s2 | ||
) |
Compute the set difference of.
s1 | and |
s2 | (elements that are in S1 but no S2) |
std::set<T> emp::difference | ( | emp::vector< T > | s1, |
emp::vector< T > & | s2 | ||
) |
Compute the set difference of.
s1 | and |
s2 | (elements that are in S1 but no S2) |
std::set<T> emp::difference | ( | std::set< T > & | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set difference of.
s1 | and |
s2 | (elements that are in S1 but not S2) |
std::set<T> emp::difference | ( | emp::vector< T > | s1, |
std::set< T > & | s2 | ||
) |
Compute the set difference of.
s1 | and |
s2 | (elements that are in S1 but no S2) |
|
inline |
Build a new range of type double.
void emp::EcoSelect | ( | World< ORG > & | world, |
const emp::vector< std::function< double(ORG &)> > & | extra_funs, | ||
const emp::vector< double > & | pool_sizes, | ||
size_t | t_size, | ||
size_t | tourny_count = 1 |
||
) |
void emp::EcoSelect | ( | World< ORG > & | world, |
const emp::vector< typename World< ORG >::fun_calc_fitness_t > & | extra_funs, | ||
double | pool_sizes, | ||
size_t | t_size, | ||
size_t | tourny_count = 1 |
||
) |
EcoSelect can be provided a single value if all pool sizes are identical.
void emp::EliteSelect | ( | World< ORG > & | world, |
size_t | e_count = 1 , |
||
size_t | copy_count = 1 |
||
) |
==ELITE== Selection picks a set of the most fit individuals from the population to move to the next generation. Find top e_count individuals and make copy_count copies of each.
world | The emp::World object with the organisms to be selected. |
e_count | How many distinct organisms should be chosen, starting from the most fit. |
copy_count | How many copies should be made of each elite organism? |
|
inlinestatic |
Return a const reference to an empty string. This function is useful to implement other functions that need to return a const reference for efficiency, but also need a null response.
double emp::Entropy | ( | const CONTAINER & | weights | ) |
Convert a vector of weights to probabilities and return the entropy of the system.
double emp::Entropy | ( | const CONTAINER & | objs, |
WEIGHT_FUN | fun, | ||
double | total = 0.0 |
||
) |
Calculate the entropy in a container of arbitrary objects. Args are a container, a function to extract the weight of each member, and an (optional) total weight.
double emp::Entropy | ( | const CONTAINER & | objs, |
CAT_FUN_X | funX, | ||
CAT_FUN_Y | funY, | ||
WEIGHT_FUN | funW | ||
) |
Conitional Entropy: H(X|Y) Allow for entropy of arbitrary objects with a converter.
constexpr double emp::Entropy2 | ( | const double | p | ) |
Calculate the entropy when their are two possibile states based on one state's probability.
|
static |
A fast method of calculating e^x.
|
inline |
Take any map, run find() member function, and return the result found (or default value if no results found).
|
inline |
Return the position of the first one bit (in a 64-bit unsigned int)
|
inline |
Return the position of the first one bit (in a 32-bit unsigned int)
std::string emp::FindExample | ( | const DFA & | dfa, |
const size_t | min_size = 1 |
||
) |
Method to find an example string that satisfies a DFA.
size_t emp::FindIndex | ( | const T & | v, |
const std::function< bool(typename T::value_type, typename T::value_type)> & | fun | ||
) |
Find the index with the "optimal" value (picks first in cases of a tie).
v | Any object allowing indexing (e.g. vector, array, etc.) |
fun | Comparison function; returns true if the first value os more optimal than second. |
size_t emp::FindMaxIndex | ( | const T & | v | ) |
Find the index with the maximal value (picks first in cases of a tie).
size_t emp::FindMinIndex | ( | const T & | v | ) |
Find the index with the minimal value (picks first in cases of a tie).
|
inline |
Take any map and element, run find() member function, and return a reference to the result found (or default value if no results found).
int emp::FindValue | ( | const emp::vector< T > | vec, |
const T & | val, | ||
size_t | start_pos = 0 |
||
) |
Return the first position of a value in a vector (or -1 if none exists)
std::multimap<B,A> emp::flip_map | ( | const std::map< A, B > & | src | ) |
Take an std::map<A,B> and return the flipped map (now multimap to be safe): std::multimap<B,A>
constexpr std::pair<B,A> emp::flip_pair | ( | const std::pair< A, B > & | p | ) |
Take an std::pair<A,B> and return the flipped pair std::pair<B,A>
|
inline |
This function tries to convert a string into any type you're looking for... You just need to specify the out type as the template argument.
|
inline |
The from_string() function can also take multiple args instead of a return.
|
inline |
The from_strings() function takes a vector of strings and convets them into a vector of the appropriate type.
constexpr int emp::get_type_index | ( | ) |
std::map<std::string, std::string> emp::get_type_to_string_map | ( | ) |
This function returns a std::map mapping typeid names to the appropriate strings to describe those types in Javscript. This is useful when using getValue() from within EM_ASM macros.
For example, say we have a templated function that takes a pointer to type T. We find out the appropriate string for type T: std::map<const char*, std::string> type_map = GetTypeToStringMap(); std::string type_string = type_map[typeid(T).name()];
Now we can pass type_string.c_str() into EM_ASM_ARGS: `EM_ASM_ARGS({ var value = getValue($0, $1); }, pointer, type_string.c_str();`
|
static |
Function to generate an empty exception (returned when an exception is checked, but none exist.)
|
inline |
Get the first waiting exception.
|
static |
A map of all exceptions that have occurred and are awaiting to be dealt with.
emp::vector<std::string> emp::GetHSLMap | ( | size_t | map_size, |
double | min_h = 0.0 , |
||
double | max_h = 360.0 , |
||
int | min_s = 100 , |
||
int | max_s = 100 , |
||
int | min_l = 50 , |
||
int | max_l = 50 |
||
) |
Generate a vector of color strings providing ranges of all of hue, satuation and luminosity.
const emp::vector<std::string>& emp::GetHueMap | ( | size_t | map_size, |
double | min_h = 0.0 , |
||
double | max_h = 360.0 , |
||
int | s = 100 , |
||
int | l = 50 |
||
) |
Generate a vector of color strings with a specified range of hues, and fixed satuation and luminosity,
|
inline |
Return an emp::vector<int> numbered 0 through size-1 in a random order.
bool emp::GetPtrDebug | ( | ) |
constexpr size_t emp::GetSize | ( | T(&) | [N] | ) |
Determine the size of a built-in array.
|
inline |
Get the current time, as provided by the web browser.
|
inline |
Determine with height of the current window.
|
inline |
Determine with width of the current window.
|
inline |
Take any map type, and run find to determine if a key is present.
bool emp::Has | ( | const emp::vector< T > | vec, |
const T & | val | ||
) |
Return whether a value exists in a vector.s.
bool emp::Has | ( | const std::set< T, H > & | s, |
const T & | val | ||
) |
Test if an std::set has a particular element without modifying the set in any way.
bool emp::Has | ( | const std::multiset< T, H > & | s, |
const T & | val | ||
) |
Test if an std::multiset has a particular element without modifying the set in any way.
bool emp::Has | ( | const std::unordered_set< T, H > & | s, |
const T & | val | ||
) |
Test if an std::unordered_set has a particular element without modifying the set in any way.
bool emp::Has | ( | const std::unordered_multiset< T, H > & | s, |
const T & | val | ||
) |
Test if an std::unordere_multiset has a particular element without modifying the set in any way.
|
inline |
Determine if there are any letters or digits anywhere in a string.
|
inline |
Determine if there are any digits in a string.
|
inline |
Determine if there are any letters, digit, or underscores anywhere in a string.
|
inline |
Determine if there are any letters in a string.
|
inline |
Determine if there are any lowercase letters in a string.
|
inlinestatic |
Determine if a specified set of characters appears anywhere in a string.
constexpr bool emp::has_type | ( | ) |
constexpr bool emp::has_type | ( | ) |
constexpr bool emp::has_unique_first_type | ( | ) |
constexpr bool emp::has_unique_first_type | ( | ) |
constexpr bool emp::has_unique_types | ( | ) |
constexpr bool emp::has_unique_types | ( | ) |
|
inline |
Determine if there are any uppercase letters in a string.
|
inline |
Determine if there is whitespace anywhere in a string.
|
inline |
Are any exceptions waiting?
|
inline |
Are any exceptions of a particular type waiting?
std::size_t emp::Hash | ( | const T & | x | ) |
T emp::HeapExtract | ( | emp::vector< T > & | v | ) |
Extraxt maximum element from a heap.
bool emp::Heapify | ( | emp::vector< T > & | v, |
size_t | id | ||
) |
Heapify an individual node in a vector.
void emp::Heapify | ( | emp::vector< T > & | v | ) |
Heapify all elements in a vector.
void emp::HeapInsert | ( | emp::vector< T > & | v, |
T | val | ||
) |
Insert a new element into a heap.
|
static |
Stub for when Emscripten is not in use.
|
static |
Stub for when Emscripten is not in use.
void emp::insert | ( | std::set< T > & | s1, |
const std::set< T > & | s2 | ||
) |
Insert the full contents of s2 into s1.
void emp::InternalError | ( | Ts &&... | msg | ) |
Original library implementers must have made an error.
constexpr double emp::InterpolateTable | ( | T && | table, |
double | pos, | ||
double | tsize | ||
) |
The following function takes a table and a position [0.0, 1.0) and intepolates a value.
std::set<T> emp::intersection | ( | std::set< T > | s1, |
std::set< T > | s2 | ||
) |
Compute the set intersection of.
s1 | and |
s2 | (elements that are in both S1 and S2) |
std::set<T> emp::intersection | ( | emp::vector< T > | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set intersection of.
s1 | and |
s2 | (elements that are in both S1 and S2) |
std::set<T> emp::intersection | ( | std::set< T > | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set intersection of.
s1 | and |
s2 | (elements that are in both S1 and S2) |
std::set<T> emp::intersection | ( | emp::vector< T > | s1, |
std::set< T > | s2 | ||
) |
Compute the set intersection of.
s1 | and |
s2 | (elements that are in both S1 and S2) |
|
static |
A compile-time int-log calculator (aka, significant bits)
|
static |
A fast method for calculating exponents for int types.
|
inline |
Build a new range of type int.
|
inline |
Determine if a character is a letter or digit.
|
inlinestatic |
Determine if a string is composed only of a set of characters (represented as a string)
|
inline |
Determine if a character is a digit.
|
inline |
Determine if a character is a letter, digit, or underscore.
|
inline |
Determine if a character is a letter of any kind.
|
inline |
Determine if a character is a lowercase letter.
|
inlinestatic |
Determine if a character is in a set of characters (represented as a string)
constexpr bool emp::is_ptr_type_v | ( | const T & | ) |
|
inline |
Determine if a character is an uppercase letter.
|
inline |
If no functions are provided to is_valid(), always return false as base case.
|
inline |
Determine if a character passes any of the test functions provided.
|
inlinestatic |
For a string to be valid, each character must pass at least one provided function.
|
inline |
Determine if a character is whitespace.
BitSet<NUM_BITS1+NUM_BITS2> emp::join | ( | const BitSet< NUM_BITS1 > & | in1, |
const BitSet< NUM_BITS2 > & | in2 | ||
) |
|
inline |
Remove all whitespace at the beginning of a string. Return the whitespace removed.
void emp::LexicaseSelect | ( | World< ORG > & | world, |
const emp::vector< std::function< double(ORG &)> > & | fit_funs, | ||
size_t | repro_count = 1 , |
||
size_t | max_funs = 0 |
||
) |
==LEXICASE== Selection runs through multiple fitness functions in a random order for EACH offspring produced.
world | The emp::World object with the organisms to be selected. |
fit_funs | The set of fitness functions to shuffle for each organism reproduced. |
repro_count | How many rounds of repliction should we do. (default 1) |
max_funs | The maximum number of fitness functions to use. (use 0 for all; default) |
void emp::LibraryError | ( | Ts &&... | msg | ) |
Library user has made an error in how they are using the library.
void emp::LibraryWarning | ( | Ts &&... | msg | ) |
Library user has made an error in how they are using the library.
int emp::LineageLength | ( | Ptr< taxon_t > | taxon | ) |
Returns the total number of times a mutation of type
type | that along |
taxon | 's lineage. (Different from CountMuts in that CountMuts sums them whereas CountMutSteps would count two simultaneous mutations of the same type as one event) |
|
static |
Compile-time natural log calculator.
Graph emp::load_graph_sym | ( | std::istream & | is, |
bool | sub1 = false |
||
) |
Helper function for loading symetric graphs from an input stream. sub1 indicates that verticies are numbered 1 to N instead of 0 to N-1.
Graph emp::load_graph_sym | ( | std::string | filename, |
bool | sub1 = false |
||
) |
Load a graph with a specified filename.
Graph emp::load_graph_table | ( | std::istream & | is | ) |
Load a graph from a connection matrix. Format: #vertices followed by v^2 0's or 1's
Graph emp::load_graph_table | ( | std::string | filename | ) |
Load a graph from a connection matrix in a file by the specified name.
|
static |
Compile-time log calculator.
|
static |
Compile-time log base 10 calculator.
|
static |
Compile-time log base 2 calculator.
auto emp::make_action | ( | const std::function< RETURN(ARGS...)> & | in_fun, |
const std::string & | name = "" |
||
) |
Build an action object using this function.
ContainerDataFile<CONTAINER> emp::MakeContainerDataFile | ( | std::function< CONTAINER(void)> | fun, |
const std::string & | filename, | ||
const std::string & | b = "" , |
||
const std::string & | s = "," , |
||
const std::string & | e = "\n" |
||
) |
Convenience function for building a container data file.
fun | is the function to call to update the container |
DataInterface* emp::MakeDataInterface | ( | ) |
Range<T> emp::MakeRange | ( | T | _l, |
T | _u | ||
) |
Build a new range with auto-detected type.
|
static |
Quick bit-mask generator for high bits.
|
static |
Quick bit-mask generator for low bits.
constexpr T emp::Max | ( | T | in1 | ) |
Max of only one element is that element itself!
constexpr T emp::Max | ( | T | in1, |
T | in2, | ||
Ts... | extras | ||
) |
Max of multiple elements is solved recursively.
const T& emp::Max | ( | std::initializer_list< const T & > | lst | ) |
A version of Max that allows a variable number of inputs to be compared.
constexpr const T& emp::MaxRef | ( | const T & | in1 | ) |
MaxRef works like Max, but never copies any inputs; always treats as references. MaxRef of only one element returns reference to that element itself!
constexpr const T& emp::MaxRef | ( | const T & | in1, |
const T & | in2, | ||
const Ts &... | extras | ||
) |
MaxRef of multiple elements returns reference to maximum value.
RET_TYPE emp::MaxResult | ( | std::function< RET_TYPE(ARG_TYPE)> & | fun, |
C & | elements | ||
) |
Run the provided function on every member of a container and return the MAXIMUM result.
constexpr T emp::MaxValue | ( | ) |
Determine the maximum value for any type.
emp::sfinae_decoy<double, typename C::value_type> emp::Mean | ( | C & | elements | ) |
Calculate the mean of the values in a container If values are pointers, they will be automatically de-referenced Values must be numeric.
std::enable_if<std::is_scalar<RET_TYPE>::value, double>::type emp::MeanResult | ( | std::function< RET_TYPE(ARG_TYPE)> & | fun, |
C & | elements | ||
) |
Run the provided function on every member of a container and return the AVERAGE result. Function must return a scalar (i.e. numeric) type.
|
static |
Merge multiple automata (DFA, NFA, RegEx) into one DFA.
|
static |
Merge multiple automata into one NFA (base case, single converstion)
|
static |
Merge multiple automata (DFA, NFA, RegEx) into one NFA.
constexpr T emp::Min | ( | T | in1 | ) |
Min of only one element is that element itself!
constexpr T emp::Min | ( | T | in1, |
T | in2, | ||
Ts... | extras | ||
) |
Min of multiple elements is solved recursively.
constexpr const T& emp::Min | ( | const T & | in1, |
const T & | in2, | ||
const T & | in3 | ||
) |
Return the minimum of three values.
const T& emp::Min | ( | std::initializer_list< const T & > | lst | ) |
A version of Min that allows a variable number of inputs to be compared.
constexpr const T& emp::MinRef | ( | const T & | in1 | ) |
MinRef works like Min, but never copies any inputs; always treats as references. MinRef of only one element returns reference to that element itself!
constexpr const T& emp::MinRef | ( | const T & | in1, |
const T & | in2, | ||
const Ts &... | extras | ||
) |
MinRef of multiple elements returns reference to minimum value.
RET_TYPE emp::MinResult | ( | std::function< RET_TYPE(ARG_TYPE)> & | fun, |
C & | elements | ||
) |
Run the provided function on every member of a container and return the MINIMUM result.
|
inline |
% is actually remainder; Mod is a proper modulus command that handles negative #'s correctly
|
inline |
Regular Mod doesn't work on doubles. Build one that does!
Ptr<T> emp::NewArrayPtr | ( | size_t | array_size, |
ARGS &&... | args | ||
) |
Create a pointer to an array of objects.
Ptr<T> emp::NewPtr | ( | ARGS &&... | args | ) |
Create a new Ptr of the target type; use the args in the constructor.
void emp::Notify | ( | Ts &&... | args | ) |
Send information to a program user (via standard error in native mode, or alter in Emscripten)
void emp::NotifyError | ( | Ts &&... | msg | ) |
End user has done something resulting in an non-recoverable problem.
void emp::NotifyWarning | ( | Ts &&... | msg | ) |
End user has done something possibly a problem.
|
static |
Provide a function to call whenever a window's size changes (no arguments).
|
static |
Provide a function to call whenever a window's size changes (new size as arguments)
|
static |
std::ostream& emp::operator<< | ( | std::ostream & | out, |
const emp::Ptr< T > & | ptr | ||
) |
std::istream& emp::operator>> | ( | std::istream & | is, |
emp::Ptr< T > & | ptr | ||
) |
void emp::pass_array_to_cpp | ( | emp::array< T, SIZE > & | arr, |
bool | recurse = false |
||
) |
This function lets you pass an array from javascript to C++! It takes a reference to the array as an argument and populates it with the contents of emp.__outgoing_array.
Currently accepts arrays of ints, floats, doubles, chars, and std::strings The size of the passed array must be equal to the size of the array stored in emp.__outgoing_array
void emp::pass_array_to_javascript | ( | C | values | ) |
This function can be called to pass an array, vector, or other container with contiguously stored data into Javascript. The array will be stored in emp.__incoming_array. Currently supports arrays containing all of the types defined in get_type_to_string_map, which are also all of the types that emscripten supports getting via pointer. This function also supports nested arrays, and arrays of objects created with introspective tuple structs.
void emp::pass_vector_to_cpp | ( | emp::vector< T > & | arr, |
bool | recurse = false |
||
) |
Same as pass_array_to_cpp, but lets you store values in a vector instead.
|
inline |
Get and remove a waiting exception.
|
static |
A fast (O(log p)) integral-power command.
|
static |
A fast method for calculating exponents on doubles.
|
static |
A fast 2^x command.
void emp::Print | ( | const emp::vector< T > & | v, |
std::ostream & | os = std::cout , |
||
const std::string & | spacer = " " |
||
) |
Print the contects of a vector.
T emp::Product | ( | const emp::vector< T > & | v | ) |
Multiply all of the contents of a vector.
Generate a random BitVector of the specified size.
|
inline |
Generate a random double vector in the specified range.
Generate a random BitVector of the specified size.
|
inline |
Generate a random vector in the specified type and range.
void emp::RandomSelect | ( | World< ORG > & | world, |
size_t | r_count = 1 , |
||
size_t | copy_count = 1 |
||
) |
==RANDOM== Selection picks an organism with uniform-random probability form the populaiton.
world | The emp::World object with the organisms to be selected. |
r_count | How many distinct organisms should be chosen? |
copy_count | How many copies should be made of each chosen organism? |
|
inline |
Generate a random size_t vector in the specified range.
|
inline |
Generate a random vector in the specified type and range.
|
inlinestatic |
Remove instances of characters from file.
|
inlinestatic |
Remove all characters from a string except letters, numbers, and whitespace.
|
inlinestatic |
Remove all whitespace from anywhere within a string.
void emp::ResourceSelect | ( | World< ORG > & | world, |
const emp::vector< std::function< double(const ORG &)> > & | extra_funs, | ||
emp::vector< emp::Resource > & | pools, | ||
size_t | t_size, | ||
size_t | tourny_count = 1 , |
||
double | frac = .0025 , |
||
double | max_bonus = 5 , |
||
double | cost = 0 , |
||
bool | use_base = true |
||
) |
|
inline |
Remove all whitespace at the end of a string.
void emp::RouletteSelect | ( | World< ORG > & | world, |
size_t | count = 1 |
||
) |
==ROULETTE== Selection (aka Fitness-Proportional Selection) chooses organisms to reproduce based on their current fitness.
world | The emp::World object with the organisms to be selected. |
count | How many organims should be selected for replication? (with replacement) |
void emp::sample_with_replacement | ( | ForwardIterator | first, |
ForwardIterator | last, | ||
OutputIterator | ofirst, | ||
OutputIterator | olast, | ||
RNG | rng | ||
) |
Draw a sample (with replacement) from an input range, copying to the output range.
Draw a sample (with replacement) from an input range, copying to the output range.
std::set<T> emp::set_union | ( | std::set< T > | s1, |
std::set< T > | s2 | ||
) |
Compute the set union of.
s1 | and |
s2 | (elements that are in either S1 or S2) |
std::set<T> emp::set_union | ( | emp::vector< T > | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set union of.
s1 | and |
s2 | (elements that are in either S1 or S2) |
std::set<T> emp::set_union | ( | std::set< T > | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set union of.
s1 | and |
s2 | (elements that are in either S1 or S2) |
std::set<T> emp::set_union | ( | emp::vector< T > | s1, |
std::set< T > | s2 | ||
) |
Compute the set union of.
s1 | and |
s2 | (elements that are in either S1 or S2) |
|
static |
Set the background color of this web page.
|
static |
|
static |
void emp::SetDefaultFitFun | ( | WORLD & | world | ) |
void emp::SetDefaultGetGenomeFun | ( | WORLD & | world | ) |
void emp::SetDefaultMutFun | ( | WORLD & | world | ) |
void emp::SetDefaultPrintFun | ( | WORLD & | world | ) |
void emp::SetDiverseElites | ( | World< ORG > & | world, |
TraitSet< ORG > | traits, | ||
size_t | world_size | ||
) |
This first version will setup a Diverse-Elites world and specify traits to use.
void emp::SetDiverseElites | ( | World< ORG > & | world, |
size_t | world_size | ||
) |
Setup a Diverse-Elites world, given the provided world already has set of phenotypes.
void emp::SetMapElites | ( | World< ORG > & | world, |
TraitSet< ORG > | traits, | ||
const emp::vector< size_t > & | trait_counts | ||
) |
Set the population to use a MapElites structure. This means that organism placement has two key components: 1: Organism position is based on their phenotypic traits. 2: Organisms must have a higher fitness than the current resident of a position to steal it.
Note: Since organisms compete with their predecessors for space in the populations, synchronous generations do not make sense.
This for version will setup a MAP-Elites world; traits to use an how many bins for each (trait counts) must be provided.
Setup a MAP-Elites world, given the provided set of traits. Requires world to already have a size; that size is respected when deciding trait bins.
void emp::SetMapElites | ( | World< ORG > & | world, |
const emp::vector< size_t > & | trait_counts | ||
) |
Setup a MAP-Elites world, given the provided trait counts (number of bins). Requires world to already have a phenotypes that those counts are applied to.
void emp::SetMapElites | ( | World< ORG > & | world | ) |
Setup a MAP-Elites world, given the provided worlds already has size AND set of phenotypes. Requires world to already have a size; that size is respected when deciding trait bins.
void emp::SetPools | ( | World< ORG > & | world, |
size_t | num_pools, | ||
size_t | pool_size, | ||
bool | synchronous_gen = false |
||
) |
Set the population to be a set of pools that are individually well mixed, but with limited migtation. Arguments are the number of pools, the size of each pool, and whether the generations should be synchronous (true) or not (false, default).
void emp::SetPtrDebug | ( | bool | _d = true | ) |
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value, double>::type emp::ShannonEntropy | ( | C & | elements | ) |
Calculate Shannon Entropy of the members of the container passed.
std::enable_if<emp::is_ptr_type<typename C::value_type>::value, double>::type emp::ShannonEntropy | ( | C & | elements | ) |
Calculate Shannon Entropy of the members of the container when those members are pointers.
|
inline |
Randomly reorder all of the elements in a vector. If max_count is provided, just make sure that the first max_count entries are randomly drawn from entire vector.
|
inline |
Take an existing graph, and build a new one that is isomorphic to it, but with randomized vertex IDs.
auto emp::shuffle_tuple | ( | const std::tuple< Ts... > & | tup, |
IntPack< Ps... > | |||
) |
Reorganize the entries in tuple; the provided int pack must specify the new ordering.
double emp::SimpleMatchCoeff | ( | const BitSet< NUM_BITS > & | in1, |
const BitSet< NUM_BITS > & | in2 | ||
) |
Computes simple matching coefficient (https://en.wikipedia.org/wiki/Simple_matching_coefficient).
emp::vector<T> emp::Slice | ( | emp::vector< T > | vec, |
int | start, | ||
int | stop | ||
) |
Returns a vector containing a chunk of elements from
vec | starting at |
start | and going up to but not including |
stop. |
|
inlinestatic |
Cut up a string based on the provided delimitor; fill them in to the provided vector.
|
inlinestatic |
Slice a string without passing in result vector (may be less efficient).
void emp::Sort | ( | emp::vector< T > & | v, |
Ts... | args | ||
) |
A quick shortcut for sorting a vector.
|
static |
A simple function to square a value.
emp::sfinae_decoy<double, typename C::value_type> emp::StandardDeviation | ( | C & | elements | ) |
Calculate the standard deviation of the values in a container If values are pointers, they will be automatically de-referenced Values must be numeric.
|
inline |
Return a prefix of the input string (up to a specified delimeter), but do not modify it. If the delimeter is not found, return the entire input string.
|
inline |
Return a prefix of the input string (up to any of a specified set of delimeters), but do not modify it. If the delimeter is not found, return the entire input string.
|
inline |
Return a prefix of a string, up to the first newline (do not modify the original string)
|
inlinestatic |
Get a segment from the beginning of a string as another string, leaving original untouched.
|
inline |
Return a prefix of a string, up to the first whitespace (do not modify the original string)
|
inline |
Remove a prefix of the input string (up to a specified delimeter) and return it. If the delimeter is not found, return the entire input string and clear it.
|
inline |
Remove a prefix of the input string (up to any of a specified set of delimeters) and return it. If the delimeter is not found, return the entire input string and clear it.
|
inlinestatic |
Pop a segment from the beginning of a string as another string, shortening original.
|
inline |
Remove a prefix of a string, up to the first newline, and return it.
|
inline |
Remove a prefix of a string, up to the first whitespace, and return it.
auto emp::SubsetCall | ( | std::function< RETURN(FUN_ARGS...)> | fun, |
CALL_ARGS... | args | ||
) | -> RETURN |
Identify the number of parameters in a function and pass in correct number of argument.
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename C::value_type>::value, typename C::value_type>::type emp::Sum | ( | C & | elements | ) |
Calculate sum of the members of the container passed Only works on containers with a scalar member type
std::enable_if<emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename emp::remove_ptr_type<typename C::value_type>::type >::value, typename emp::remove_ptr_type<typename C::value_type>::type >::type emp::Sum | ( | C & | elements | ) |
Calculate sum of the values pointed at by pointers in a container Only works on containers of pointers to a scalar type
T emp::Sum | ( | const emp::vector< T > & | v | ) |
Sum up the contents of a vector.
std::set<T> emp::symmetric_difference | ( | std::set< T > | s1, |
std::set< T > | s2 | ||
) |
Compute the set symmetric_difference of.
s1 | and |
s2 | (elements that are in either S1 or S2 but not both) |
std::set<T> emp::symmetric_difference | ( | emp::vector< T > | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set symmetric_difference of.
s1 | and |
s2 | (elements that are in either S1 or S2 but not both) |
std::set<T> emp::symmetric_difference | ( | std::set< T > | s1, |
emp::vector< T > | s2 | ||
) |
Compute the set symmetric_difference of.
s1 | and |
s2 | (elements that are in either S1 or S2 but not both) |
std::set<T> emp::symmetric_difference | ( | emp::vector< T > | s1, |
std::set< T > | s2 | ||
) |
Compute the set symmetric_difference of.
s1 | and |
s2 | (elements that are in either S1 or S2 but not both) |
constexpr bool emp::test_type | ( | ) |
constexpr bool emp::test_type_exist | ( | ) |
constexpr bool emp::test_type_value | ( | ) |
|
static |
|
inlinestatic |
A function timer that takes a functor an identifies how long it takes to complete when run.
Converting DFA to DFA – no change needed.
Systematic conversion of NFA to DFA...
Conversion of RegEx to DFA, via NFA intermediate.
|
inlinestatic |
Convert a single chararcter to one that uses a proper escape sequence (in a string) if needed.
|
inlinestatic |
Convert a full string to one that uses proper escape sequences, as needed.
function_traits<Function>::function emp::to_function | ( | Function & | lambda | ) |
function_traits<Function>::pointer emp::to_function_pointer | ( | Function & | lambda | ) |
|
inline |
Take a value and convert it to a C++-style literal.
|
inlinestatic |
Take a char and convert it to a C++-style literal.
|
inlinestatic |
Take a string and convert it to a C++-style literal.
|
inlinestatic |
Convert a string to all lowercase.
Converting NFA to MFA – no change needed.
|
inlinestatic |
|
inline |
This function does its very best to convert everything it's to a string. Takes any number of arguments and returns a single string containing all of them concatenated. Objects can be any normal (POD) data type, container, or anything that can be passed into a stringstream.
|
inlinestatic |
Convert a string to all uppercase.
|
inline |
Toggle an input bool.
Ptr<T> emp::ToPtr | ( | T * | _in, |
bool | own = false |
||
) |
Convert a T* to a Ptr<T>. By default, don't track.
constexpr TYPE emp::ToRange | ( | const TYPE & | value, |
const TYPE & | in_min, | ||
const TYPE & | in_max | ||
) |
Run both min and max on a value to put it into a desired range.
void emp::TournamentSelect | ( | World< ORG > & | world, |
size_t | t_size, | ||
size_t | tourny_count = 1 |
||
) |
==TOURNAMENT== Selection creates a tournament with a random sub-set of organisms, finds the one with the highest fitness, and moves it to the next generation. User provides the world (with a fitness function), the tournament size, and (optionally) the number of tournaments to run.
world | The emp::World object with the organisms to be selected. |
t_size | How many organisms should be placed in each tournament? |
tourny_count | How many tournaments should be run? (with replacement of organisms) |
Ptr<T> emp::TrackPtr | ( | T * | _in, |
bool | own = true |
||
) |
Convert a T* to a Ptr<T> that we DO track.
constexpr size_t emp::tree_left | ( | size_t | id | ) |
Tree manipulation in vectors.
constexpr size_t emp::tree_parent | ( | size_t | id | ) |
constexpr size_t emp::tree_right | ( | size_t | id | ) |
|
inline |
Provide information about an exception that needs to be triggered.
auto emp::TruncateCall | ( | std::function< R(PARAMS...)> | fun, |
ARGS &&... | args | ||
) |
|
inline |
Quick way to calculate tuple size.
constexpr uint32_t emp::UIntMaskFirst | ( | ) |
Create a series of a specified number of ones (at compile time) in a uint.
constexpr uint32_t emp::UIntMaskFirst< 0 > | ( | ) |
Create an empty bit mask (all zeros)
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value, int>::type emp::UniqueCount | ( | C & | elements | ) |
Count the number of unique elements in a container.
std::enable_if<emp::is_ptr_type<typename C::value_type>::value, int>::type emp::UniqueCount | ( | C & | elements | ) |
Count the number of unique elements in the container of pointers. (compares objects pointed to; pointers do not have to be identical)
|
inlinestatic |
A function that will always return a unique stringname (using UniqVal) with provided prefix and postfix.)
|
static |
A function that will always return a unique value (and trip an assert if it can't...)
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename C::value_type>::value, double>::type emp::Variance | ( | C & | elements | ) |
Calculate variance of the members of the container passed Only works on containers with a scalar member type
std::enable_if<emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename emp::remove_ptr_type<typename C::value_type>::type >::value, double>::type emp::Variance | ( | C & | elements | ) |
Calculate variance of the values pointed at by members of the container passed Only works on containers with a scalar member type
constexpr size_t emp::ByteCount[256] |
How many bits are set to one in each possible byte?
constexpr const int32_t emp::cos_chart_1K[] |
constexpr const double emp::E = 2.71828 |
e
constexpr const double emp::log2_chart_1_2[] |
Large table to log base-2 results.
constexpr const uint32_t emp::MAX_2BYTE = 65535 |
(2^16 - 1)
constexpr const uint32_t emp::MAX_3BYTE = 16777215 |
(2^24 - 1)
constexpr const uint32_t emp::MAX_4BYTE = 4294967295 |
(2^32 - 1)
constexpr const uint32_t emp::MAX_BYTE = 255 |
(2^8 - 1)
constexpr const uint32_t emp::MAX_UINT = 4294967295 |
(2^32 - 1)
constexpr const uint32_t emp::MAX_WORD = 65535 |
(2^16 - 1)
constexpr const int32_t emp::MIN_INT = -2147483648 |
(- 2^31)
constexpr const double emp::PHI = 1.61803398874 |
Golden ratio.
constexpr const double emp::PI = 3.14159265358979 |
pi
constexpr const double emp::pow2_chart_0_1[] |
Table to provide results of Pow2 from 0 to 1.
constexpr const double emp::pow2_chart_bits[] |
Table to provide results of Pow2 for values of bits (0.1, 0.01, 0.001, etc, in binary)
constexpr const int32_t emp::sin_chart_1K[] |
constexpr const double emp::SQRT2 = 1.41421356237310 |
sqrt(2)
constexpr const int32_t emp::tan_chart_1K[] |
constexpr bool emp::variadic_contains_v |
|
static |