fidoandfido / blackswan

Blackswan Stock Game
Other
2 stars 0 forks source link

New AI behaviour, using historical data #17

Open fidoandfido opened 13 years ago

fidoandfido commented 13 years ago

An idea for A.I.

By keeping track of how many positive or negative quarters there have been, we could add a premium to a company. Thus, if a company has 4 positive quarters in a row (ie average or better), the price should be pushed up, if this continues, the price should be pushed even higher, and so on.

This could be done by adding two fields to company - goodQuarterRunLength and badQuarterRunLength. At the end of a period, the company would set the counts accordingly - if the last 2 quarters were all good, the bad counter would be 0, and the good counter would 2. Then, during the next period, if there were 4 good quarters, the good counter would be set to 6 (bad sitll 0). During the current period, it would be up to the AI to take the value of the counters from the company object and update them based on the most recent profit results.