🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

"How to loop through all values in a nominal set"

User: "macaron"
New Altair Community Member
Updated by Jocelyn
Hi everyone.

The Loop Values operator's wiki states throughout that it iterates over "all the possible values of the selected attribute".

In view of this, I expected the process
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
   <process expanded="true">
     <operator activated="true" class="generate_data_user_specification" compatibility="5.3.008" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="45" y="75">
       <list key="attribute_values">
         <parameter key="a" value="&quot;hello&quot;"/>
       </list>
       <list key="set_additional_roles"/>
     </operator>
     <operator activated="true" class="add" compatibility="5.3.008" expanded="true" height="76" name="Add" width="90" x="179" y="75">
       <parameter key="attribute_name" value="a"/>
       <parameter key="new_value" value="world"/>
     </operator>
     <operator activated="true" class="loop_values" compatibility="5.3.008" expanded="true" height="76" name="Loop Values" width="90" x="313" y="75">
       <parameter key="attribute" value="a"/>
       <process expanded="true">
         <operator activated="true" class="print_to_console" compatibility="5.3.008" expanded="true" height="76" name="Print to Console" width="90" x="112" y="30">
           <parameter key="log_value" value="%{loop_value}"/>
         </operator>
         <connect from_port="example set" to_op="Print to Console" to_port="through 1"/>
         <connect from_op="Print to Console" from_port="through 1" to_port="out 1"/>
         <portSpacing port="source_example set" spacing="0"/>
         <portSpacing port="sink_out 1" spacing="0"/>
         <portSpacing port="sink_out 2" spacing="0"/>
       </process>
     </operator>
     <connect from_op="Generate Data by User Specification" from_port="output" to_op="Add" to_port="example set input"/>
     <connect from_op="Add" from_port="example set output" to_op="Loop Values" to_port="example set"/>
     <portSpacing port="source_input 1" spacing="0"/>
     <portSpacing port="sink_result 1" spacing="0"/>
   </process>
 </operator>
</process>
to print to the console:
hello
world
But it only prints
hello
Is there a way in which I can iterate over the entire nominal set of the attribute, even those values that do not appear in the particular data currently provided?

Regards,
Kurk

Find more posts tagged with