Hi,
I am trying to have my source assign item label values based on a normal distribution.
So, i want the label values to occur in a normal distribution with mean 17 and s.d. 3. But i only want the values that lie between 8 and 26.
The code i used is shown below:
The problem i am facing is that some items are released with no label value. So i think what it is doing is if the value lies outside the range, it does not assign any value to that item. I want to avoid this. Please suggest a solution to ensure all items are labeled based on the specified range.
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
{ // ************* PickOption Start ************* //
/***popup:SetLabel*/
/**Set Label*/
Object involved = /** \nObject: *//***tag:object*//**/item/**/;
string labelname = /** \nLabel: *//***tag:label*//**/"Type"/**/;
int value = /** \nValue: *//***tag:value*//**/normal(17,3,getstream(current))/**/;
if (value>=8 && value<=26)
{
involved.labels.assert(labelname).value = value;
}
} // ******* PickOption End ******* //