[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: Combination analysis & TS



PureBytes Links

Trading Reference Links

Wow!  Now That Gary Fritz is smart.

Best regards,
  Jimmy Snowden
mailto:jhsnowden@xxxxxxx


Friday, December 5, 2003, 11:38:51 AM, you wrote:

>> Does somebody knows how can i ask TS2000i to find each possible
>> combinations out of 8 differents setups conditions and apply each
>> one in a system ? 
>> Is there a function code in TS2000i to do  that  ?

GF> No, but you can do it with a bit of trickery.

GF> With 8 separate setups, you will have 2^8 = 256 different 
GF> combinations to test.  255, actually, since you're probably not 
GF> interested in the case of NO setups.  

GF> You can just loop from 1 to 255 and determine which bits are 
GF> turned on in an integer representation of your counter.  If bit 0 
GF> is turned on, include setup 0.  If bit 1 is turned on, include 
GF> setup 1, etc.

GF> In TS2k there are no integer variables, but you can approximate 
GF> it with floating-point values.  Let's say you use a function like 
GF> this:

GF>         { Boolean function BitNOn }

GF>         { Returns True if the 2^N bit in a numeric value is on. }
GF>         { Rightmost bit is N = 0.                               }
                                
GF>         input:  IntVal(numeric), N(numeric);

GF>         BitNOn = mod(IntPortion(IntVal / Power(2, N)), 2) = 1;

GF> Then you could code your test something like this:

GF> input: TestNumber(0);

GF> if BitNOn(TestNumber, 0) then TestSetup0;
GF> if BitNOn(TestNumber, 1) then TestSetup1;
GF> if BitNOn(TestNumber, 2) then TestSetup2;
GF> if BitNOn(TestNumber, 3) then TestSetup3;
GF> if BitNOn(TestNumber, 4) then TestSetup4;
GF> if BitNOn(TestNumber, 5) then TestSetup5;
GF> if BitNOn(TestNumber, 6) then TestSetup6;
GF> if BitNOn(TestNumber, 7) then TestSetup7;

GF> Run an optimization of TestNumber from 1 to 255.
GF> Gary




Outgoing mail scanned by Norton