Skip to content

Commit

Permalink
{ccm} Fix goal's spreading activation so if it isn't set explicitly i…
Browse files Browse the repository at this point in the history
…t defaults to 0.0

This is the default according to the ACR-T manual (pg. 275).

Related to #325
  • Loading branch information
asmaloney committed Jul 31, 2023
1 parent 58a885f commit 5667eda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions actr/modules/goal.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ type Goal struct {
Module

// "spreading_activation": see "Spreading Activation" in "ACT-R 7.26 Reference Manual" pg. 290
// ccm (DMSpreading.weight): 1.0
// pyactr (buffer_spreading_activation): no default
// ccm (DMSpreading.weight): 0.0
// pyactr (buffer_spreading_activation): 0.0
// vanilla (:ga): 0.0
SpreadingActivation *float64
}
Expand Down
6 changes: 5 additions & 1 deletion framework/ccm_pyactr/ccm_pyactr.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ func (c *CCMPyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code
c.Writeln(" spread.strength = %s", numbers.Float64Str(*memory.MaxSpreadStrength))

goalActivation := c.model.Goal.SpreadingActivation
if goalActivation != nil {
if goalActivation == nil {
// if it isn't set, then it should default to 0.0
// ACR-T Manual pg. 275
c.Writeln(" spread.weight[%s] = 0.0", "goal")
} else {
c.Writeln(" spread.weight[%s] = %s", "goal", numbers.Float64Str(*goalActivation))
}

Expand Down

0 comments on commit 5667eda

Please sign in to comment.