BFCast


Inherits From:
SwarmObject
Declared In:
BFCast.h


Class Description

A BFCast is an object that holds all the forcecasting components of a bit forecast. That means it has a BitVector (a thing called "conditions" in the code that keeps track of which world bits are being monitored) as well as other coefficients that are used to calculate forecasts. It has instance variables that record when the rule was last used, how many times it has been used, how accururate its predictions are, and so forth.


Instance Variables

double forecast;
double lforecast;
double variance;
double strength;
double a;
double b;
double c;
double specfactor;
double bitcost;
BitVector *conditions;
int lastactive;
int specificity;
int count;
int condwords;
int condbits;
int nnulls;

forecastthis forecast of return
lforecastprevious forecast
variancevariance of this forecast
strengthstrength=maxdev - variance +specfactor. This was the original sfsm specification, not the ASM-2.0 specification
a(price + dividend) coefficient
bdividend coefficient
cconstant term
specfactorspecificty=(condbits - nnulls - specificity)* bitcost.
bitcostcost of using bits in forecasts
conditionsa BitVector object that holds records on which conditions in the world are being monitored by this forecast object
lastactivelast time period in which this forecast was active
specificityspecificity
countnumber of times this forecast has been active
condwordsnumber of words of memory needed to hold the conditions
condbitsnumber of bits of information monitored by this forecast
nnullsnumber of 'unused' bits that remain in the allocated vector after the 'condbits' bits have been used


Method Types

- createEnd
- incrSpecificity
- decrSpecificity
- setSpecificity:
- getSpecificity
- setConditions:
- getConditions
- getConditionsObject
- setNNulls:
- setBitcost:
- setConditionsWord:To:
- getConditionsWord:
- setConditionsbit:To:
- setConditionsbit:FromZeroTo:
- maskConditionsbit:
- switchConditionsbit:
- getConditionsbit:
- setAval:
- setBval:
- setCval:
- getAval
- getBval
- getCval
- updateSpecfactor
- setSpecfactor:
- getSpecfactor
- setVariance:
- getVariance
- setCondwords:
- setCondbits:
- setForecast:
- getForecast
- updateForecastPrice:Dividend:
- setLforecast:
- getLforecast
- setLastactive:
- getLastactive
- setCnt:
- getCnt
- incrCount
- setStrength:
- getStrength
- copyEverythingFrom:
- print
- printcond:
- drop

Instance Methods

copyEverythingFrom:

- copyEverythingFrom:(BFCast *)from

Given an input forecast object, systematically ask it for all its IVARs and replace current settings with them.


createEnd

- createEnd

No method description.


decrSpecificity

- (void)decrSpecificity

Reduce the specificity value of this forecast by one unit


drop

- (void)drop

Free dynamically allocated memory


getAval

- (double)getAval

Return a coefficient from demand equation


getBval

- (double)getBval

Return b coefficient from demand equation


getCnt

- (int)getCnt

Return the value of count


getConditions

- (int *)getConditions

Returns a pointer to an array, the integer representation of the conditions


getConditionsObject

- (BitVector *)getConditionsObject

Returns an object of type BitVector, the represnetation of conditions that is actually used inside this class or calculations


getConditionsWord:

- (int)getConditionsWord:(int)x

Returns the integer representation of the x'th word in the conditions


getConditionsbit:

- (int)getConditionsbit:(int)bit

Returns 0,1,or 2, for a given bit in the conditions records


getCval

- (double)getCval

Return c coefficient from demand equation


getForecast

- (double)getForecast

Return forecast from this object


getLastactive

- (int)getLastactive

Return the time on which this forecast was last active


getLforecast

- (double)getLforecast

Get forecast from the previous time period


getSpecfactor

- (double)getSpecfactor

Return the specfactor value of this forecast


getSpecificity

- (int)getSpecificity

Return the specificity of this forecast


getStrength

- (double)getStrength

Return strength of this forecast


getVariance

- (double)getVariance

Return the variance of this forecast


incrCount

- (int)incrCount

Increment this forecast's count variable


incrSpecificity

- (void)incrSpecificity

Raise the specificity value of this forecast by one unit


maskConditionsbit:

- (void)maskConditionsbit:(int)bit

No method description.


print

- print

Return some disgnostic information about the status of variables inside this forecast to the terminal


printcond:

- printcond:(int)conditions

No method description.


setAval:

- (void)setAval:(double)x

Set a coefficient from demand equation


setBitcost:

- (void)setBitcost:(double)x

Set the variable bitcost at x


setBval:

- (void)setBval:(double)x

Set b coefficient from demand equation


setCnt:

- (void)setCnt:(int)x

Set the count variable to an inputted value


setCondbits:

- (void)setCondbits:(int)x

Sets the number of bits. This is the number of aspect of the world that are monitored


setConditions:

- (void)setConditions:(int *)x

Rather than individually set bits one by one, we might want to set all of them at once. That means we pass in a pointer to an array of words that is the "right size" for all the bits.


setConditionsWord:To:

- (void)setConditionsWord:(int)i To:(int)value

For low level access to a full word's-worth of the condition


setConditionsbit:FromZeroTo:

- (void)setConditionsbit:(int)bit FromZeroTo:(int)x

If a bit is currently set to 0 ("don't care"), then change it to something else (1 or 2)


setConditionsbit:To:

- (void)setConditionsbit:(int)bit To:(int)x

Sets the value of a bit in the conditions


setCondwords:

- (void)setCondwords:(int)x

Sets the number of words-worth's of conditions that are going to be used


setCval:

- (void)setCval:(double)x

Set c coefficient from demand equation


setForecast:

- (void)setForecast:(double)x

Set the forecast of this object to an inputted value


setLastactive:

- (void)setLastactive:(int)x

Set the time on which this forecast was last active to an input value


setLforecast:

- (void)setLforecast:(double)x

Set the previous forecast of this object to an inputted value


setNNulls:

- (void)setNNulls:(int)x

Null bits may be needed if the bit vector that is allocated is larger than the number of conditions being monitored. Since a bitvector allocates space in sizes of words, this might be important. Luckily, in the current design of ASM-2.0 (and after), there are no null bits.


setSpecfactor:

- (void)setSpecfactor:(double)x

Set the specfactor value of this forecast


setSpecificity:

- (void)setSpecificity:(int)specificity

Set the specificity of this forecast


setStrength:

- (void)setStrength:(double)x

Set the strength value to an inputted value


setVariance:

- (void)setVariance:(double)x

Set the variance of this forecast


switchConditionsbit:

- (void)switchConditionsbit:(int)bit

Change a YES to a NO, and vice versa


updateForecastPrice:Dividend:

- (double)updateForecastPrice:(double)price Dividend:(double)dividend

Calculate new forecast on basis of price and dividend information


updateSpecfactor

- (void)updateSpecfactor

Update the spec factor of this forecast. That means calculate: specfactor= (condbits - nnulls - specificity)* bitcost


Version 1.1 Copyright ©2001. All Rights Reserved.