Пример #1
0
        // Calculate the walkabout strength, the stay flag, and, if it is
        // 'stay', the value for the current output of this
        // constraint. Assume this constraint is satisfied.
        public override void recalculate()
        {
            Variable invar = input(), outvar = output();

            outvar.walkStrength = Strength.weakestOf(strength, invar.walkStrength);
            outvar.stay         = invar.stay && scale.stay && offset.stay;
            if (outvar.stay)
            {
                execute();          // stay optimization
            }
        }
Пример #2
0
        // Calculate the walkabout strength, the stay flag, and, if it is
        // 'stay', the value for the current output of this
        // constraint. Assume this constraint is satisfied.
        //
        public override void recalculate()
        {
            Variable invar = input(), outvar = output();

            outvar.walkStrength = Strength.weakestOf(strength, invar.walkStrength);
            outvar.stay         = invar.stay;
            if (outvar.stay)
            {
                execute();
            }
        }