## selection of a shape for branching

##### selection of a shape for branching
 Author Message peter posted 5 Months Ago ANSWER Group: Forum Members Posts: 46, Visits: 159 +x peter - 12/2/2021I see you point , thank you for all your help >(1) The conditions aren't mutually exclusive. For example, if distance is exactly equal to to shape.50pct.heightpx/2, this meets both the first as well as the second condition: / branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance <= shape.50pct.heightpx/2) {trial.TL_high}  else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance <= shape.75pct.heightpx/2) {trial.NS}  else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high}  else {trial.choice}] Do you have any suggestions as to how to resolve the above issue?for example can i transform expressions.distance into a screen percentage?Many thanks Peter Dave posted 5 Months Ago ANSWER Group: Administrators Posts: 12K, Visits: 81K +x peter - 12/2/2021+x peter - 12/2/2021I see you point , thank you for all your help >(1) The conditions aren't mutually exclusive. For example, if distance is exactly equal to to shape.50pct.heightpx/2, this meets both the first as well as the second condition: / branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance <= shape.50pct.heightpx/2) {trial.TL_high}  else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance <= shape.75pct.heightpx/2) {trial.NS}  else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high}  else {trial.choice}] Do you have any suggestions as to how to resolve the above issue?for example can i transform expressions.distance into a screen percentage?Many thanks Peter> for example can i transform expressions.distance into a screen percentage?You can, but that obviously does nothing to resolve the issue.The problem is that you have "is equal to" in both conditions. Just define ranges that are mutually exclusive. branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance < shape.50pct.heightpx/2) {trial.TL_high}  else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance < shape.75pct.heightpx/2) {trial.NS}  else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high}  else {trial.choice}]You just need to decide which of the conditions should include the equality case and which shouldn't. peter posted 5 Months Ago ANSWER Group: Forum Members Posts: 46, Visits: 159 +x Dave - 12/2/2021+x peter - 12/2/2021+x peter - 12/2/2021I see you point , thank you for all your help >(1) The conditions aren't mutually exclusive. For example, if distance is exactly equal to to shape.50pct.heightpx/2, this meets both the first as well as the second condition: / branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance <= shape.50pct.heightpx/2) {trial.TL_high}  else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance <= shape.75pct.heightpx/2) {trial.NS}  else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high}  else {trial.choice}] Do you have any suggestions as to how to resolve the above issue?for example can i transform expressions.distance into a screen percentage?Many thanks Peter> for example can i transform expressions.distance into a screen percentage?You can, but that obviously does nothing to resolve the issue.The problem is that you have "is equal to" in both conditions. Just define ranges that are mutually exclusive. branch = [if (expressions.distance >= shape.25pct.heightpx/2 && expressions.distance < shape.50pct.heightpx/2) {trial.TL_high}  else if (expressions.distance >= shape.50pct.heightpx/2 && expressions.distance < shape.75pct.heightpx/2) {trial.NS}  else if (expressions.distance >= shape.75pct.heightpx/2 && expressions.distance <= shape.100pct.heightpx/2) {trial.TL_high}  else {trial.choice}]You just need to decide which of the conditions should include the equality case and which shouldn't.I see well that's nice and simple then thanks for your help Peter

#### Merge Selected

Merge into selected topic...

Merge into merge target...

Merge into a specific topic ID...