A ConfigurationOrder statement in the rule language e.g. More...
#include <RuleBasedProgramTree.h>
Public Types | |
enum class | SameProperty { container , traversal , dataLayout , newton3 , loadEstimator , cellSizeFactor } |
Enum containing all possible values of 'with same' options. | |
Public Member Functions | |
ConfigurationOrder ()=default | |
Constructs a configuration order that says all configurations are better than all configurations. | |
~ConfigurationOrder () override=default | |
Destructor. | |
ConfigurationOrder (ConfigurationPattern greater, ConfigurationPattern smaller, std::vector< SameProperty > same={}) | |
Construct a configuration order. | |
void | generateCode (CodeGenerationContext &context, RuleVM::Program &program) const override |
Generates code for this statement. | |
std::string | toString () const |
bool | haveEqualSameProperties (const Configuration &conf1, const Configuration &conf2) const |
Checks if two configurations have the equal same properties as required by this configuration order. | |
![]() | |
virtual | ~Statement ()=default |
Virtual default constructor. | |
virtual void | generateCode (CodeGenerationContext &context, RuleVM::Program &program) const =0 |
Generates code for this statement. | |
Public Attributes | |
ConfigurationPattern | greater |
The greater/better configuration pattern. | |
ConfigurationPattern | smaller |
The smaller/worse configuration pattern. | |
std::vector< SameProperty > | sameProperties |
Vector containing all set same properties. | |
A ConfigurationOrder statement in the rule language e.g.
'[container=LinkedCells, newton3=enabled] >= [container=DirectSum] with same cellSizeFactor' This order says that all configurations that match the left pattern (configuration has LinkedCells as container and newton3 enabled) are better that all configurations that match the right pattern (configuration has container DirectSum), provided they have the the same cellSizeFactor.
|
default |
Constructs a configuration order that says all configurations are better than all configurations.
Will never be true.
autopas::RuleSyntax::ConfigurationOrder::ConfigurationOrder | ( | ConfigurationPattern | greater, |
ConfigurationPattern | smaller, | ||
std::vector< SameProperty > | same = {} |
||
) |
Construct a configuration order.
greater | The pattern of better configuration orders. |
smaller | The pattern of worse configuration orders. |
same | The same properties of the order. |
|
overridevirtual |
Generates code for this statement.
context | The context to generate code in. |
program | The program to append the code to. |
Implements autopas::RuleSyntax::Statement.
bool autopas::RuleSyntax::ConfigurationOrder::haveEqualSameProperties | ( | const Configuration & | conf1, |
const Configuration & | conf2 | ||
) | const |
Checks if two configurations have the equal same properties as required by this configuration order.
conf1 | One configuration. |
conf2 | Another configuration. |
std::string autopas::RuleSyntax::ConfigurationOrder::toString | ( | ) | const |