Research Article
Effective Application of Improved Profit-Mining Algorithm for the Interday Trading Model
Pseudocode 2
The pseudocode of genSP.
(1) genSP | (2) Parameters: | (3) BP, prefix : Pattern | (4) index, interval : int | (5) Begin | (6) if interval > maxspan then | (7) return | (8) end if | (9) if index < then | (10) for = index to | (11) SP = oneItemList[] | (12) SP = shift(SP, interval) | (13) SP = join(prefix, SP) | (14) | (15) if sup(SP) ≥ minsup | (16) if BP ≤ SP // Prevent From Duplication | (17) ruleset = ruleGenerator(BP, SP) | (18) for each in ruleset | (19) result = simulate() | (20) if result satisfy thresholds | (21) output(, result) | (22) end if | (23) end for | (24) genSP(BP, SP, , interval ) | (25) end if | (26) end if | (27) end for | (28) end if | (29) if prefix.length > 0 then | (30) genSP(BP, prefix, 0, interval + 1) | (31) end if |
|