Various bugfixes and additions

This commit is contained in:
maartenkeijzer 2005-11-24 09:35:34 +00:00
commit 44876f0926
24 changed files with 889 additions and 187 deletions

View file

@ -86,8 +86,11 @@ functor_t LanguageTable::get_random_function() const
return rng.choice(pimpl->functions);
}
token_t LanguageTable::get_random_function(unsigned arity) const
token_t LanguageTable::get_random_function(token_t token, unsigned arity) const
{
if (pimpl->functions_per_arity.size() <= arity || pimpl->functions_per_arity[arity].empty()) {
return token; // return original token if no functions of this arity are found
}
return rng.choice(pimpl->functions_per_arity[arity]);
}