Ps-i 2.2 - attributes

General description

An attribute is a quality of a particular agent. It can be expressed as a number, a true/false value or something more comlex.

Section format

The following is an example describing attribute influence:
attribute 'influence'
	type int
	smallest 0
	largest 1000
	default 1
end
As you can see the attribute section starts with the keyword attribute that is followed by the name of this particular attribute. Then we see a series of keywords followed by parameters. The section is completed with keyword end.

Available keywords
KeywordValueAttribute typeDescription
typeint, bool, repertoire, set Declares type of the attribute. Should be followed by one of bool,int, set or repertoire.
Note: currently set is not fully implemented
defaulte.g. 10anySpecifies default value (optional)
smalleste.g. -3intSpecifies smallest possible value
largeste.g. 200intSpecifies largest possible value
sizee.g. 10set, repertoireSpecifies size of the set or repertoire. Limited to 64 for sets and 56 for repertoires.
bias_mine.g. 4repertoireminimum possible value for bias. (valid only for attributes of type repertoire)
bias_maxe.g. -3repertoiremaximum possible value for bias. (valid only for attributes of type repertoire)
bias_vole.g 500repertoirelikelihood that a given bias value will change on this timestep. (in units of 0.01%) (valid only for attributes of type repertoire)
walkno argumentrepertoireduring evolution a particular bias value can only change by +1 or -1 during one timestep
jumpno argumentrepertoireduring evolution a particular bias value can change to any possible value during one timestep
bias_valuese.g. 1,-1,2,3repertoirethis keyword is used to specify initial bias values. it is only used in snapshots and will _never_ be accessed if loading as a model.
bias_init_routine e.g. "bias_init"repertoirespecifies a routine to define initial values for bias
bias_update_routine e.g. "bias_update_jump"repertoireSpecifies a routine for updating bias values. When present, keywords jump, walk, bias_max, bias_min and bias_vol are disregarded.

More examples

attribute 'immutable'
	type bool
	default false
end

routine 'bias_init' composite
	comment 'This sets initial biases to zero for all identities except first'
	when "$1==1"  "-1"
	default "0"
end

routine 'bias_update1' composite
	comment 'Set 2 to 0 always, otherwise jump randomly between -5 and 4'
	when "$1==2" "0"
	default "(rand/1000)-5"
end

attribute 'cache'
	type repertoire
	walk
	size 20
	bias_max 2
	bias_min -2
	bias_vol  500
	default empty
	bias_init_routine "bias_init"
	bias_update_routine "bias_update1"
end

Related

See also About Ps-i 2.2, Agent classes.