A program to recognize and reward our most engaged community members
Marius wrote:Which operator are you exactly referring to?
<?xml version="1.0" encoding="UTF-8" standalone="no"?><process version="5.2.009"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="5.2.009" expanded="true" name="Process"> <process expanded="true" height="389" width="727"> <operator activated="true" class="generate_data" compatibility="5.2.009" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30"/> <operator activated="true" class="set_macro" compatibility="5.2.009" expanded="true" height="76" name="Set Macro" width="90" x="179" y="30"> <parameter key="macro" value="value"/> <parameter key="value" value="3"/> </operator> <operator activated="true" class="generate_attributes" compatibility="5.2.009" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="30"> <list key="function_descriptions"> <parameter key="att1_clone" value="att1"/> </list> </operator> <operator activated="true" class="discretize_by_user_specification" compatibility="5.2.009" expanded="true" height="94" name="Discretize" width="90" x="447" y="30"> <parameter key="attribute_filter_type" value="single"/> <parameter key="attribute" value="att1"/> <list key="classes"> <parameter key="first" value="%{value}"/> <parameter key="last" value="Infinity"/> </list> </operator> <connect from_op="Generate Data" from_port="output" to_op="Set Macro" to_port="through 1"/> <connect from_op="Set Macro" from_port="through 1" to_op="Generate Attributes" to_port="example set input"/> <connect from_op="Generate Attributes" from_port="example set output" to_op="Discretize" to_port="example set input"/> <connect from_op="Discretize" from_port="example set output" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator></process>
Marius wrote:Can you please provide an example process? For me, the following process works like a charm: <?xml version="1.0" encoding="UTF-8" standalone="no"?><process version="5.2.009"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="5.2.009" expanded="true" name="Process"> <process expanded="true" height="389" width="727"> <operator activated="true" class="generate_data" compatibility="5.2.009" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30"/> <operator activated="true" class="set_macro" compatibility="5.2.009" expanded="true" height="76" name="Set Macro" width="90" x="179" y="30"> <parameter key="macro" value="value"/> <parameter key="value" value="3"/> </operator> <operator activated="true" class="generate_attributes" compatibility="5.2.009" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="30"> <list key="function_descriptions"> <parameter key="att1_clone" value="att1"/> </list> </operator> <operator activated="true" class="discretize_by_user_specification" compatibility="5.2.009" expanded="true" height="94" name="Discretize" width="90" x="447" y="30"> <parameter key="attribute_filter_type" value="single"/> <parameter key="attribute" value="att1"/> <list key="classes"> <parameter key="first" value="%{value}"/> <parameter key="last" value="Infinity"/> </list> </operator> <connect from_op="Generate Data" from_port="output" to_op="Set Macro" to_port="through 1"/> <connect from_op="Set Macro" from_port="through 1" to_op="Generate Attributes" to_port="example set input"/> <connect from_op="Generate Attributes" from_port="example set output" to_op="Discretize" to_port="example set input"/> <connect from_op="Discretize" from_port="example set output" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator></process>
When a simple expression is used as a parameter %{val1}-%{val2} .... it is parsed and substituted (e.g. as 3-1) but not executed.
After confirming this kind of value -%{val2} it will simply disappear.
Marius wrote:Ok, I can reproduce that. Operator fields are dumb - they never parse expressions, but expect ready made values, i.e. numbers in this case. You have to use Generate Macro to calculate new macro values from existing ones.
Here we made our lives easy: in this field you are only allowed to enter numbers. So we are checking if you either entered a number, or if you entered a macro (more precise: if the expression starts with "%{"). I admit that this is improvable, but until now it is sufficient in 99% of all cases Best, Marius
fritmore wrote:p.s.: I think I am not the only one who does not utilize the macros to their fullest, maybe you should dedicated some space to it in the upcoming Operator manual.