Agents coding work but need add on two variable data

If you want to map sub ranges of values to single value each, use a cascade of if statements:

if (x > 0.3123 && x < 0.3914){
  y = 1;
}
else if (x > 0.5012 && 0.5987){
  y = 2;
}

If you want to map ranges of values to other ranges, you can use map() or lerp():

if (x >= 0.3123 && x < 0.3914){
  y = map(x, 0.3123, 0.3914, 0, 1);
}
else if (x >= 0.5012 && x < 0.5987){
  y = map(x, 0.5012, 0.5987, 1, 2);
}
else if ( ...