constraining parameter values

2 views
Skip to first unread message

Emily Greenfest-Allen

unread,
Aug 1, 2011, 10:39:19 AM8/1/11
to strategies...@googlegroups.com
Hi-

We have a stringParam whose possible values need to be constrained to
decimal value ranging between 0.7 and 1.0.

Is there anyway to specify this constraint in the model?

Thanks,

Emily

Jerric Gao

unread,
Aug 1, 2011, 10:58:28 AM8/1/11
to strategies...@googlegroups.com
Hi Emily,

Yes, you can add a <regex><![CDATA[....]]></regex> in the string param.

Jerric

Emily Greenfest-Allen

unread,
Aug 1, 2011, 11:02:01 AM8/1/11
to strategies...@googlegroups.com
Jerric-

Thanks, for the response, but could you be a bit more explicit? I am
still unclear.

Are you saying, <regex><![CDATA[0.7-0.1]]></regex>
?

Emily

Jerric Gao

unread,
Aug 1, 2011, 11:09:57 AM8/1/11
to strategies...@googlegroups.com
The regular expression you need could be something like this:
((0\.7)|(0\.8)|(0\.9)\d*)|(1(\.0*)?)

You might be able to come up with better regex.

Elisabetta Manduchi

unread,
Aug 1, 2011, 11:19:27 AM8/1/11
to strategies...@googlegroups.com

In our case we want strictly < 1. I think this shorter version should
work, shouldn't it?

0\.[7-9]\d*

However I think we have a more general question. In this case the
numeric range can be easily specified with a regular expression.
Conceivably (I have not thought of an example though) there might be
situations where the range is complicate enough that it would be desirable
to be able to specify it as a numeric range using <, <=, >, >=. Would a
feature such as this be at all possible with the WDK?

Elisabetta

---

Elisabetta Manduchi

unread,
Aug 1, 2011, 11:59:35 AM8/1/11
to strategies...@googlegroups.com

Does WDK 2.1 allow better error messages when a user enters a parameter
out of the specified constraints?

For example, with the below regular expression, in WDK 1.28, if one enters
0.6 the error says:

"Similarity Score Greater Than: stringParam geneParams.similarityScoreP
value '0.6' does not match regular expression '0\.[7-9]\d*' "

which would be obscure to a general user.

Is it possible in WDK 2.1 to replace this with a more intelligible error
message chosen by the developer for that param?

Elisabetta


---

Reply all
Reply to author
Forward
0 new messages