4 replies [Last post]
jeshyr's picture
User offline. Last seen 29 weeks 5 days ago. Offline
Joined: 09/19/2011
Groups: Androids

The new exploration puzzle 488 has the clash importance "fiddled" so that if you lower it below approximately 0.25 everything implodes the way it normally does way around 0.0 - this means you can't currently run almost any script at all.

Here's a reasonably easy way to edit almost any script to work - it probably won't be ideal, but you can at least use it while you fiddle around with fixing other things. It should be fine even if you are not a coder

1. You'll find a line in MOST scripts which looks like this:

CI=set_behavior_clash_importance

If you find that line then delete it - if you can't find in then skip to ADVANCED down this post further...

Most scripts written by people who write lots of scripts (e.g. rav3n, taloc, etc.) do use this line but other script writers may not.

2. In the exact place that line used to be, add this bit of code by copying/pasting:

function Relative_Clash_Importance(x)
-- Treat argument as fraction between min-max
-- Argument must be between 0-1
max_CI=1.0
min_CI=0.25

range=max_CI - min_CI
new_CI = (range * x) + min_CI
set_behavior_clash_importance(new_CI)
print("CI requested is ",x,", actual CI used: ",new_CI)
end

CI=Relative_Clash_Importance

You can fiddle with the min_CI and max_CI settings which are the minimum and maximum clash importance settings you want to allow - just change the numbers from 1.0 and 0.25 to whatever you want. They need to be between 0 and 1 and max_CI needs to be bigger than min_CI but that's about the only limits you have.

This will basically RESCALE your script's clash importance to fit between your min_CI and max_CI values, so you shouldn't have to edit anything outside this snippet at all as long as your script uses the CI=set_behavior_clash_importance line in it already.

This is all - try pressing "run" and it should work fine!

ADVANCED:

If the script you want to mess with does NOT use that "CI=set_behavior_clash_importance" line in it already you can still edit it by following these instructions:

1. At EVERY place in the script which has a line that looks like this:

set_behavior_clash_importance(0.5)

(with any number between 0 and 1, not just 0.5) you can change it so it says this:

CI(0.5)

Change the number so it matches whatever it was before you changed it - just change the bit that says "set_behaviour_clash_impoortance" to say "CI" and you should be right. You have to change every instance in the whole script EXCEPT the one in the snippet you added .

2. At the very top of the script (above what is currently line 1) add the same script listed in step 2 above.

Now press "run" and watch it work!

If all the recipe output is making you a bit crazy trying to watch the script's regular output, just delete the whole line that starts with "print" and that will shut it up.

If you have tried and failed with any specific script then write down EXACTLY what the error code was and what happened when you pressed "run" (a screen shot helps) and post here and I'll try to help you. But you must try first!

ptfrog's picture
User offline. Last seen 5 years 18 weeks ago. Offline
Joined: 09/29/2011
If you want to ensure that

If you want to ensure that your script only runs at low CI, you should prefix the working part of the script with CI(1) -- which will set the clash index to maxCI. Otherwise, your script may be running at a higher CI value till the first call to set CI().

It's also useful to note that you can include this in your script and still get it to work the same way it always did: just set minCI=0 and maxCI = 1, and CI() will be the same as set_behavior_clash_importance(). But by including this code, you have the option of easily changing the CI values anytime you wish. This will become even more useful when scripts have an interactive component.

Finally: Sometimes you will have a need to run at a CI value that is not in the range of minCI to maxCI. Some scripts, for instance, use CI=0 at certain parts. While you can just call the library function for this, I create a new function called forceCI(). This makes it clear that you are bypassing the CI() function on purpose, and not through an oversight. In keeping with the style above, it might look like this:

function Absolute_Clash_Importance(x)
-- bypass the min/max range restrictions to CI
set_behavior_clash_importance(x)
print("Forcing CI value to ",x)
end

function Relative_Clash_Importance(x)
-- Treat argument as fraction between min-max
-- Argument must be between 0-1
max_CI=1.0
min_CI=0.25

range=max_CI - min_CI
new_CI = (range * x) + min_CI
set_behavior_clash_importance(new_CI)
print("CI requested is ",x,", actual CI used: ",new_CI)
end

CI=Relative_Clash_Importance
forceCI=Absolute_Clash_Importance

jeshyr's picture
User offline. Last seen 29 weeks 5 days ago. Offline
Joined: 09/19/2011
Groups: Androids
Cool additions, ptfrog, the

Cool additions, ptfrog, the "force" function is especially useful.

The other thing I'd like to see and which could fairly easily be implemented if this was part of the "standard" libraries that script writers used is that we could redistribute the range of CI values according so a mathematical function or look-up table if the user wanted. This could be interestingly used to "skew" the CI value towards a higher, lower, or "u" shaped distribution so we can see how that affects various scripts in a very easy manner.

e.g. the Relative_Clash_Importance() function above remaps the full 0.0-1.0 range onto a smaller range but doesn't skew it all. It could also be remapped in other ways quite simply if script writers used this functionality by default.

One way to skew the range 0.0-1.0 is to multiply it by 10 (range is now 0.0-10.0), square it (range is now 0.0-100.0), then divide by 100 (range is now 0.0-1.0 again so we can use it for CI). This has the affect of making values smaller but not all numbers change evenly: e.g. 0.1 * 10 = 1, 1 squared is 1, 1 divided by 100 is 0.01 .... or eg 0.75 * 10 = 7.5, 7.5 squared is 56.25, divide by 100 is 0.5625 ... 0.90 comes out as 0.81 ... 0.99 comes out as 0.98 I think ... Other mathematical functions will have other effects of course.

I don't know if this will have much effect on any scripts but it might be interesting to try.

ptfrog's picture
User offline. Last seen 5 years 18 weeks ago. Offline
Joined: 09/29/2011
Neat thought, jeshyr! I love

Neat thought, jeshyr! I love the concept. Though it is hard to guess what would work best -- values skewed towards the high or low end. The u-shape you mention is one I think I'd like to try: skewing based on distance from the middle, so high values skew up and low values skew down.

Till this week, I would have guessed that the differences between small CI values are more important, so I'd be inclined to have those remain large at the expense of smushing together the higher CI values. But now that we've seen proteins that wiggle fine at CI=1.0 and collapse at .99, I would say that all bets are off. :-)

Joined: 06/17/2010
A bit changed CI function

We not always need/want to scale CI so it should be optional:


maxCI=1 --maximum Clash importance
minCI=0.25 --minimum clash importance
scaledCI=false --if true CI is scaled to max ci, if false only cut to max
-- ie: for maxCI=0.5 and minCI=0 when calling CI(0.6) will cause
-- 0.5 on false (non scaled)
-- 0.3 on true (scaled)

function CI(c)
if scaledCI==true then
local rng=maxCI-minCI
if c > maxCI or c < minCI then c=rng*c+minCI end
else
if c > maxCI then c=maxCI end
if c < minCI then c=minCI end
end
set_behavior_clash_importance(c)
end

Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons