XJ music engine  1.9.6
In-game runtime engine for XJ music.
Public Member Functions | Static Public Member Functions | List of all members
XJ::MemeIsometry Class Reference

#include <MemeIsometry.h>

Public Member Functions

 MemeIsometry (MemeTaxonomy taxonomy, const std::set< std::string > &sourceMemes)
 
int score (const std::set< std::string > &targets) const
 
void add (const std::string &meme)
 
void add (const ProgramMeme &meme)
 
void add (const ProgramSequenceBindingMeme &meme)
 
void add (const InstrumentMeme &meme)
 
void add (const SegmentMeme &meme)
 
bool isAllowed (const std::set< std::string > &memes) const
 
std::set< std::string > getSources ()
 
std::string getConstellation () const
 

Static Public Member Functions

static MemeIsometry of (MemeTaxonomy taxonomy, const std::set< std::string > &sourceMemes)
 
static MemeIsometry of (const std::set< std::string > &sourceMemes)
 
static MemeIsometry none ()
 

Detailed Description

Determine the isometry between a source and target group of Memes

Constructor & Destructor Documentation

◆ MemeIsometry()

MemeIsometry::MemeIsometry ( MemeTaxonomy  taxonomy,
const std::set< std::string > &  sourceMemes 
)
explicit

Construct a meme isometry from source memes

Parameters
taxonomycontext within which to measure isometry
sourceMemesfrom which to construct isometry

Member Function Documentation

◆ add() [1/5]

void MemeIsometry::add ( const InstrumentMeme meme)

Add a instrument meme for isometry comparison

◆ add() [2/5]

void MemeIsometry::add ( const ProgramMeme meme)

Add a program meme for isometry comparison

◆ add() [3/5]

void MemeIsometry::add ( const ProgramSequenceBindingMeme meme)

Add a program sequence binding meme for isometry comparison

◆ add() [4/5]

void MemeIsometry::add ( const SegmentMeme meme)

Add a segment meme for isometry comparison

◆ add() [5/5]

void MemeIsometry::add ( const std::string &  meme)

Add a meme for isometry comparison

◆ getConstellation()

std::string MemeIsometry::getConstellation ( ) const

Compute normalized string representation of an unordered set of memes for the purpose of identifying unique constellations.

for each unique sequence-pattern-meme constellation within the main sequence https://github.com/xjmusic/xjmusic/issues/208

Returns
unique constellation for this set of strings.

◆ getSources()

std::set< std::string > MemeIsometry::getSources ( )

Get the source Memes

Returns
source memes

◆ isAllowed()

bool MemeIsometry::isAllowed ( const std::set< std::string > &  memes) const

Whether a list of memes is allowed because no more than one matches the category's memes

Parameters
memesThe list of memes to check
Returns
True if the list is allowed

◆ none()

MemeIsometry MemeIsometry::none ( )
static

Instantiate a new MemeIsometry representing having no memes

Returns
an empty MemeIsometry

◆ of() [1/2]

MemeIsometry MemeIsometry::of ( const std::set< std::string > &  sourceMemes)
static

Instantiate a new MemeIsometry of a group of source Memes

Parameters
sourceMemesto compare of
Returns
MemeIsometry ready for comparison to target Memes

◆ of() [2/2]

MemeIsometry MemeIsometry::of ( MemeTaxonomy  taxonomy,
const std::set< std::string > &  sourceMemes 
)
static

Instantiate a new MemeIsometry of a Taxonomy and group of source Memes

Parameters
taxonomycontext within which to measure isometry
sourceMemesto compare of
Returns
MemeIsometry ready for comparison to target Memes

◆ score()

int MemeIsometry::score ( const std::set< std::string > &  targets) const

Score a CSV list of memes based on isometry to source memes

Parameters
targetscomma-separated values to score against source meme names
Returns
score is between 0 (no matches) and the number of matching memes

The documentation for this class was generated from the following files: