Referencing property of a concept as an Expression
My concept:
I have an instance of it, named "Age".
Another concept I have is "Strategy". The purpose of it is to define how I calculate some rating based on attributes.
In my instance of a Strategy I'd like to be able to define rating like this:
Referencing Age itself is no problem. But referencing properties of a concept itself is another matter, and I don't see how to do that.
Any suggestions?
concept Attribute extends Expression implements INamedConcept properties: string name; int average; children: Attribute dependsOn;
I have an instance of it, named "Age".
Another concept I have is "Strategy". The purpose of it is to define how I calculate some rating based on attributes.
concept Strategy extends Expression implements INamedConcept children: Expression rating;
In my instance of a Strategy I'd like to be able to define rating like this:
rating = Age.average - Age + dependsOn.average
Referencing Age itself is no problem. But referencing properties of a concept itself is another matter, and I don't see how to do that.
Any suggestions?
Please sign in to leave a comment.
Create a concept AverageFieldRef implementing IOperation. Add can be child constraint (its parent should be AttributeRef or have AttributeType). Add inference rule, saying
As a sample see AsSequenceOperation concept.
It took some time for me to understand the idea but in the end, it worked perfectly.
Thanks a lot!