Hi Adhi,
To do this you will have to make use of the logical function available in AnyBody.
If you in the reference manual search for AnyFunLogical you will get to a page describing the available functions.
There is also a link to a file where the use of the functions is illustrated, i have copied its context below.
So in your case you will have use the ltfun to check if your mus activity is larger than a certain size and if so set a new variable equal to the desired value or set it to zero if mus activation is too low.
Best regards
Søren
Main = {
/// Equality testing
AnyFolder Equalities = {
AnyIntVar test1 = eqfun(1.1,0.0);
AnyIntVar test2 = eqfun(10,10);
AnyIntVar test3 = eqfun("dsdas","cscd");
AnyIntVar test4 = eqfun("anybody","anybody");
};
/// Not-equal testing
AnyFolder NotEqualities = {
AnyIntVar test1 = neqfun(1.1,0.0);
AnyIntVar test2 = neqfun(10,10);
AnyIntVar test3 = neqfun("dsdas","cscd");
AnyIntVar test4 = neqfun("anybody","anybody");
};
/// Not-equal testing by the not(..) function
AnyFolder NotEqualities2 = {
AnyIntVar test1 = not(eqfun(1.1,0.0));
AnyIntVar test2 = not(eqfun(10,10));
AnyIntVar test3 = not(eqfun("dsdas","cscd"));
AnyIntVar test4 = not(eqfun("anybody","anybody"));
};
/// Inequality testing
AnyFolder Inequalities = {
AnyIntVar lt1 = ltfun(-1.1,0.0);
AnyIntVar lt2 = ltfun(10,10);
AnyIntVar lt3 = ltfun(8,10);
AnyIntVar lt4 = ltfun(10.0,8.0);
AnyIntVar lteq1 = lteqfun(-1.1,0.0);
AnyIntVar lteq2 = lteqfun(10,10);
AnyIntVar lteq3 = lteqfun(8,10);
AnyIntVar lteq4 = lteqfun(10.0,8.0);
AnyIntVar gt1 = gtfun(-1.1,0.0);
AnyIntVar gt2 = gtfun(10,10);
AnyIntVar gt3 = gtfun(8,10);
AnyIntVar gt4 = gtfun(10.0,8.0);
AnyIntVar gteq1 = gteqfun(-1.1,0.0);
AnyIntVar gteq2 = gteqfun(10,10);
AnyIntVar gteq3 = gteqfun(8,10);
AnyIntVar gteq4 = gteqfun(10.0,8.0);
};
/// Combined tests using 'and' and 'or' functions
AnyFolder AndOr = {
AnyIntVar and1 = andfun(1,1);
AnyIntVar and2 = andfun(1.0,0.0);
AnyIntVar and3 = andfun(0.0,0.0);
AnyIntVar or1 = orfun(1,1);
AnyIntVar or2 = orfun(1.0,0.0);
AnyIntVar or3 = orfun(0.0,0.0);
};
/// if-then-else function
AnyFolder IfThenElse = {
AnyVar A = 1;
AnyVar B = 2;
AnyVar C = 3;
AnyVar D = 4;
AnyStringVar answer1 = iffun(ltfun(A,B), "A is smaller than B", "A is not smaller than B");
AnyStringVar answer2 = answer1 + " and " + iffun( andfun(ltfun(A,B),gtfun(C,D)), "C is greater than D", "C is not greater than D");
};
}; // Main