AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
autopas::RuleSyntax::ConfigurationOrder Struct Reference

A ConfigurationOrder statement in the rule language e.g. More...

#include <RuleBasedProgramTree.h>

Inheritance diagram for autopas::RuleSyntax::ConfigurationOrder:
Inheritance graph
[legend]
Collaboration diagram for autopas::RuleSyntax::ConfigurationOrder:
Collaboration graph
[legend]

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.
 
- Public Member Functions inherited from autopas::RuleSyntax::Statement
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< SamePropertysameProperties
 Vector containing all set same properties.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConfigurationOrder() [1/2]

autopas::RuleSyntax::ConfigurationOrder::ConfigurationOrder ( )
default

Constructs a configuration order that says all configurations are better than all configurations.

Will never be true.

◆ ConfigurationOrder() [2/2]

autopas::RuleSyntax::ConfigurationOrder::ConfigurationOrder ( ConfigurationPattern  greater,
ConfigurationPattern  smaller,
std::vector< SameProperty same = {} 
)

Construct a configuration order.

Parameters
greaterThe pattern of better configuration orders.
smallerThe pattern of worse configuration orders.
sameThe same properties of the order.

Member Function Documentation

◆ generateCode()

void autopas::RuleSyntax::ConfigurationOrder::generateCode ( CodeGenerationContext context,
RuleVM::Program program 
) const
overridevirtual

Generates code for this statement.

Parameters
contextThe context to generate code in.
programThe program to append the code to.

Implements autopas::RuleSyntax::Statement.

◆ haveEqualSameProperties()

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.

Parameters
conf1One configuration.
conf2Another configuration.
Returns
True, if both configurations have equal required same properties.

◆ toString()

std::string autopas::RuleSyntax::ConfigurationOrder::toString ( ) const
Returns
A string describing this order.

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