+
+ // If in a simulation, figure out priority from order in array so that customs expressions are always at the top
+ if (sim != null && sim.getCustomExpressions().contains(this)){
+ int totalExpressions = sim.getCustomExpressions().size();
+ int p = -1*(totalExpressions-sim.getCustomExpressions().indexOf(this));
+ type.setPriority(p);
+ }
+