From 5ad204cd123d4d80cd4d62bb85ca43738d3bcddf Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Fri, 1 Mar 2024 13:52:51 -0500 Subject: [PATCH] Separate run options from model Instead of storing them directly on the model, pass them as a param. The model now stores the default which come from the amod file. These may overridden by the command line or the web API. --- actr/model.go | 12 +++++---- framework/ccm_pyactr/ccm_pyactr.go | 37 +++++++++++++------------- framework/framework.go | 7 ++--- framework/pyactr/pyactr.go | 31 ++++++++++----------- framework/tools.go | 2 +- framework/vanilla_actr/vanilla_actr.go | 19 ++++++------- modes/defaultmode/defaultmode.go | 5 ++-- modes/shell/shell.go | 2 +- modes/web/model.go | 15 ++++++----- modes/web/session.go | 6 ++--- modes/web/web.go | 19 +++++++------ util/runoptions/runoptions.go | 2 +- 12 files changed, 81 insertions(+), 76 deletions(-) diff --git a/actr/model.go b/actr/model.go index 9977cbe..a2be862 100644 --- a/actr/model.go +++ b/actr/model.go @@ -44,7 +44,9 @@ type Model struct { Productions []*Production - runoptions.Options + // These defaults come from the amod file and may be overridden on the command line + // or by web requests. + DefaultParams runoptions.Options // Used to validate our parameters parameters param.ParametersInterface @@ -80,7 +82,7 @@ func (model *Model) Initialize() { model.Procedural = modules.NewProcedural() model.Modules = append(model.Modules, model.Procedural) - model.LogLevel = "info" + model.DefaultParams = runoptions.New() // Declare our parameters loggingParam := param.NewStr( @@ -293,16 +295,16 @@ func (model *Model) SetParam(kv *keyvalue.KeyValue) (err error) { switch kv.Key { case "log_level": - model.LogLevel = runoptions.ACTRLogLevel(*value.Str) + model.DefaultParams.LogLevel = runoptions.ACTRLogLevel(*value.Str) case "trace_activations": boolVal, _ := value.AsBool() // already validated - model.TraceActivations = boolVal + model.DefaultParams.TraceActivations = boolVal case "random_seed": seed := uint32(*value.Number) - model.RandomSeed = &seed + model.DefaultParams.RandomSeed = &seed default: return param.ErrUnrecognizedOption{Option: kv.Key} diff --git a/framework/ccm_pyactr/ccm_pyactr.go b/framework/ccm_pyactr/ccm_pyactr.go index c4f751d..db830f9 100644 --- a/framework/ccm_pyactr/ccm_pyactr.go +++ b/framework/ccm_pyactr/ccm_pyactr.go @@ -16,6 +16,7 @@ import ( "github.com/asmaloney/gactar/util/filesystem" "github.com/asmaloney/gactar/util/issues" "github.com/asmaloney/gactar/util/numbers" + "github.com/asmaloney/gactar/util/runoptions" ) //go:embed ccm_print.py @@ -115,8 +116,8 @@ func (c CCMPyACTR) Model() (model *actr.Model) { // Run generates the python code from the amod file, writes it to disk, creates a "run" file // to actually run the model, and returns the output (stdout and stderr combined). -func (c *CCMPyACTR) Run(initialBuffers framework.InitialBuffers) (result *framework.RunResult, err error) { - runFile, err := c.WriteModel(c.tmpPath, initialBuffers) +func (c *CCMPyACTR) Run(options *runoptions.Options, initialBuffers framework.InitialBuffers) (result *framework.RunResult, err error) { + runFile, err := c.WriteModel(c.tmpPath, options, initialBuffers) if err != nil { return } @@ -137,7 +138,7 @@ func (c *CCMPyACTR) Run(initialBuffers framework.InitialBuffers) (result *framew } // WriteModel converts the internal actr.Model to Python and writes it to a file. -func (c *CCMPyACTR) WriteModel(path string, initialBuffers framework.InitialBuffers) (outputFileName string, err error) { +func (c *CCMPyACTR) WriteModel(path string, options *runoptions.Options, initialBuffers framework.InitialBuffers) (outputFileName string, err error) { // If our model has a print statement, then write out our support file if c.model.HasPrintStatement() { err = framework.WriteSupportFile(path, ccmPrintFileName, ccmPrintPython) @@ -147,7 +148,7 @@ func (c *CCMPyACTR) WriteModel(path string, initialBuffers framework.InitialBuff } // If our model is tracing activations, then write out our support file - if c.model.TraceActivations { + if options.TraceActivations { err = framework.WriteSupportFile(path, gactarActivateTraceFileName, gactarActivateTraceFile) if err != nil { return @@ -164,7 +165,7 @@ func (c *CCMPyACTR) WriteModel(path string, initialBuffers framework.InitialBuff return "", err } - _, err = c.GenerateCode(initialBuffers) + _, err = c.GenerateCode(options, initialBuffers) if err != nil { return } @@ -178,7 +179,7 @@ func (c *CCMPyACTR) WriteModel(path string, initialBuffers framework.InitialBuff } // GenerateCode converts the internal actr.Model to Python code. -func (c *CCMPyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code []byte, err error) { +func (c *CCMPyACTR) GenerateCode(options *runoptions.Options, initialBuffers framework.InitialBuffers) (code []byte, err error) { patterns, err := framework.ParseInitialBuffers(c.model, initialBuffers) if err != nil { return @@ -195,13 +196,13 @@ func (c *CCMPyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code memory := c.model.Memory - c.writeImports() + c.writeImports(options) c.Write("\n\n") // random - if c.model.RandomSeed != nil { - c.Writeln("random.seed(%d)", *c.model.RandomSeed) + if options.RandomSeed != nil { + c.Writeln("random.seed(%d)", *options.RandomSeed) c.Write("\n\n") } @@ -237,7 +238,7 @@ func (c *CCMPyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code c.Writeln(" %s = Memory(%s)", memory.ModuleName(), memory.BufferName()) } - if c.model.TraceActivations { + if options.TraceActivations { c.Writeln(" trace = ActivateTrace(%s)", memory.ModuleName()) } @@ -286,7 +287,7 @@ func (c *CCMPyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code c.Writeln("") } - if c.model.LogLevel == "info" { + if options.LogLevel == "info" { // this turns on some logging at the high level c.Writeln(" def __init__(self):") c.Writeln(" super().__init__(log=True)") @@ -308,7 +309,7 @@ func (c *CCMPyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code c.Writeln("") - c.writeMain() + c.writeMain(options) code = c.GetContents() return @@ -346,8 +347,8 @@ func (c CCMPyACTR) writeAuthors() { c.Writeln("") } -func (c CCMPyACTR) writeImports() { - if c.model.RandomSeed != nil { +func (c CCMPyACTR) writeImports(runOptions *runoptions.Options) { + if runOptions.RandomSeed != nil { c.Writeln("import random") } @@ -379,7 +380,7 @@ func (c CCMPyACTR) writeImports() { c.Write("from python_actr import %s\n", strings.Join(additionalImports, ", ")) } - if c.model.LogLevel == "detail" { + if runOptions.LogLevel == "detail" { c.Writeln("from python_actr import log, log_everything") } @@ -388,7 +389,7 @@ func (c CCMPyACTR) writeImports() { c.Writeln(fmt.Sprintf("from %s import CCMPrint", ccmPrintImportName)) } - if c.model.TraceActivations { + if runOptions.TraceActivations { c.Writeln("") c.Writeln(fmt.Sprintf("from %s import ActivateTrace", gactarActivateTraceImportName)) } @@ -489,11 +490,11 @@ func (c CCMPyACTR) writeProductions() { } } -func (c CCMPyACTR) writeMain() { +func (c CCMPyACTR) writeMain(runOptions *runoptions.Options) { c.Writeln("if __name__ == \"__main__\":") c.Writeln(fmt.Sprintf(" model = %s()", c.className)) - if c.model.LogLevel == "detail" { + if runOptions.LogLevel == "detail" { c.Writeln(" log(summary=1)") c.Writeln(" log_everything(model)") } diff --git a/framework/framework.go b/framework/framework.go index ca31edf..4c5afa2 100644 --- a/framework/framework.go +++ b/framework/framework.go @@ -7,6 +7,7 @@ import ( "github.com/asmaloney/gactar/actr" "github.com/asmaloney/gactar/util/issues" + "github.com/asmaloney/gactar/util/runoptions" "github.com/asmaloney/gactar/util/version" ) @@ -50,9 +51,9 @@ type Framework interface { SetModel(model *actr.Model) (err error) Model() (model *actr.Model) - Run(initialBuffers InitialBuffers) (result *RunResult, err error) - WriteModel(path string, initialBuffers InitialBuffers) (outputFileName string, err error) - GenerateCode(initialBuffers InitialBuffers) (code []byte, err error) + Run(options *runoptions.Options, initialBuffers InitialBuffers) (result *RunResult, err error) + WriteModel(path string, options *runoptions.Options, initialBuffers InitialBuffers) (outputFileName string, err error) + GenerateCode(options *runoptions.Options, initialBuffers InitialBuffers) (code []byte, err error) } type List map[string]Framework diff --git a/framework/pyactr/pyactr.go b/framework/pyactr/pyactr.go index 91f1fe9..24425cc 100644 --- a/framework/pyactr/pyactr.go +++ b/framework/pyactr/pyactr.go @@ -16,6 +16,7 @@ import ( "github.com/asmaloney/gactar/util/filesystem" "github.com/asmaloney/gactar/util/issues" "github.com/asmaloney/gactar/util/numbers" + "github.com/asmaloney/gactar/util/runoptions" ) //go:embed pyactr_print.py @@ -132,8 +133,8 @@ func (p PyACTR) Model() (model *actr.Model) { return p.model } -func (p *PyACTR) Run(initialBuffers framework.InitialBuffers) (result *framework.RunResult, err error) { - runFile, err := p.WriteModel(p.tmpPath, initialBuffers) +func (p *PyACTR) Run(options *runoptions.Options, initialBuffers framework.InitialBuffers) (result *framework.RunResult, err error) { + runFile, err := p.WriteModel(p.tmpPath, options, initialBuffers) if err != nil { return } @@ -156,7 +157,7 @@ func (p *PyACTR) Run(initialBuffers framework.InitialBuffers) (result *framework } // WriteModel converts the internal actr.Model to Python and writes it to a file. -func (p *PyACTR) WriteModel(path string, initialBuffers framework.InitialBuffers) (outputFileName string, err error) { +func (p *PyACTR) WriteModel(path string, options *runoptions.Options, initialBuffers framework.InitialBuffers) (outputFileName string, err error) { // If our model has a print statement, then write out our support file if p.model.HasPrintStatement() { err = framework.WriteSupportFile(path, pyactrPrintFileName, pyactrPrintPython) @@ -175,7 +176,7 @@ func (p *PyACTR) WriteModel(path string, initialBuffers framework.InitialBuffers return "", err } - _, err = p.GenerateCode(initialBuffers) + _, err = p.GenerateCode(options, initialBuffers) if err != nil { return } @@ -189,7 +190,7 @@ func (p *PyACTR) WriteModel(path string, initialBuffers framework.InitialBuffers } // GenerateCode converts the internal actr.Model to Python code. -func (p *PyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code []byte, err error) { +func (p *PyACTR) GenerateCode(options *runoptions.Options, initialBuffers framework.InitialBuffers) (code []byte, err error) { patterns, err := framework.ParseInitialBuffers(p.model, initialBuffers) if err != nil { return @@ -204,13 +205,13 @@ func (p *PyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code []b p.writeHeader() - p.writeImports() + p.writeImports(options) p.Writeln("") // random - if p.model.RandomSeed != nil { - p.Writeln("numpy.random.seed(%d)\n", *p.model.RandomSeed) + if options.RandomSeed != nil { + p.Writeln("numpy.random.seed(%d)\n", *options.RandomSeed) } memory := p.model.Memory @@ -253,7 +254,7 @@ func (p *PyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code []b p.Writeln(" rule_firing=%s,", numbers.Float64Str(*procedural.DefaultActionTime)) } - if p.model.TraceActivations { + if options.TraceActivations { p.Writeln(" activation_trace=True,") } @@ -329,7 +330,7 @@ func (p *PyACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code []b p.Writeln("") // ...add our code to run - p.writeMain() + p.writeMain(options) code = p.GetContents() return @@ -367,8 +368,8 @@ func (p PyACTR) writeAuthors() { p.Writeln("") } -func (p PyACTR) writeImports() { - if p.model.RandomSeed != nil { +func (p PyACTR) writeImports(runOptions *runoptions.Options) { + if runOptions.RandomSeed != nil { p.Writeln("import numpy") } @@ -491,20 +492,20 @@ func (p PyACTR) writeProductions() { } } -func (p PyACTR) writeMain() { +func (p PyACTR) writeMain(runOptions *runoptions.Options) { p.Writeln("# Main") p.Writeln("if __name__ == '__main__':") options := []string{"gui=False"} - if p.model.LogLevel == "min" { + if runOptions.LogLevel == "min" { options = append(options, "trace=False") } p.Writeln(" sim = %s.simulation( %s )", p.className, strings.Join(options, ", ")) p.Writeln(" sim.run()") - if p.model.LogLevel != "min" { + if runOptions.LogLevel != "min" { p.Writeln(" if goal.test_buffer('full'):") p.Writeln(" print('chunk left in goal: ' + str(goal.pop()))") p.Writeln(" if %s.retrieval.test_buffer('full'):", p.className) diff --git a/framework/tools.go b/framework/tools.go index a1643aa..0444343 100644 --- a/framework/tools.go +++ b/framework/tools.go @@ -43,7 +43,7 @@ func GenerateCodeFromFile(fw Framework, inputFile string, initialBuffers Initial return } - code, err = fw.GenerateCode(initialBuffers) + code, err = fw.GenerateCode(&model.DefaultParams, initialBuffers) if err != nil { return } diff --git a/framework/vanilla_actr/vanilla_actr.go b/framework/vanilla_actr/vanilla_actr.go index 58bb57c..a0919a6 100644 --- a/framework/vanilla_actr/vanilla_actr.go +++ b/framework/vanilla_actr/vanilla_actr.go @@ -21,6 +21,7 @@ import ( "github.com/asmaloney/gactar/util/issues" "github.com/asmaloney/gactar/util/lisp" "github.com/asmaloney/gactar/util/numbers" + "github.com/asmaloney/gactar/util/runoptions" ) //go:embed vanilla_print.lisp @@ -105,8 +106,8 @@ func (c VanillaACTR) Model() (model *actr.Model) { return c.model } -func (v *VanillaACTR) Run(initialBuffers framework.InitialBuffers) (result *framework.RunResult, err error) { - modelFile, err := v.WriteModel(v.tmpPath, initialBuffers) +func (v *VanillaACTR) Run(options *runoptions.Options, initialBuffers framework.InitialBuffers) (result *framework.RunResult, err error) { + modelFile, err := v.WriteModel(v.tmpPath, options, initialBuffers) if err != nil { return } @@ -141,7 +142,7 @@ func (v *VanillaACTR) Run(initialBuffers framework.InitialBuffers) (result *fram } // WriteModel converts the internal actr.Model to Lisp and writes it to a file. -func (v *VanillaACTR) WriteModel(path string, initialBuffers framework.InitialBuffers) (outputFileName string, err error) { +func (v *VanillaACTR) WriteModel(path string, options *runoptions.Options, initialBuffers framework.InitialBuffers) (outputFileName string, err error) { // If our model has a print statement, then write out our support file if v.model.HasPrintStatement() { err = framework.WriteSupportFile(path, vanillaPrintFileName, vanillaPrint) @@ -160,7 +161,7 @@ func (v *VanillaACTR) WriteModel(path string, initialBuffers framework.InitialBu return "", err } - _, err = v.GenerateCode(initialBuffers) + _, err = v.GenerateCode(options, initialBuffers) if err != nil { return } @@ -174,7 +175,7 @@ func (v *VanillaACTR) WriteModel(path string, initialBuffers framework.InitialBu } // GenerateCode converts the internal actr.Model to Lisp code. -func (v *VanillaACTR) GenerateCode(initialBuffers framework.InitialBuffers) (code []byte, err error) { +func (v *VanillaACTR) GenerateCode(options *runoptions.Options, initialBuffers framework.InitialBuffers) (code []byte, err error) { patterns, err := framework.ParseInitialBuffers(v.model, initialBuffers) if err != nil { return @@ -242,7 +243,7 @@ func (v *VanillaACTR) GenerateCode(initialBuffers framework.InitialBuffers) (cod v.Writeln("\t:dat %s", numbers.Float64Str(*procedural.DefaultActionTime)) } - switch v.model.LogLevel { + switch options.LogLevel { case "min": v.Writeln("\t:trace-detail low") case "info": @@ -251,7 +252,7 @@ func (v *VanillaACTR) GenerateCode(initialBuffers framework.InitialBuffers) (cod v.Writeln("\t:trace-detail high") } - if v.model.TraceActivations { + if options.TraceActivations { v.Writeln("\t:act t") } @@ -265,8 +266,8 @@ func (v *VanillaACTR) GenerateCode(initialBuffers framework.InitialBuffers) (cod v.Writeln(")\n") // random - if v.model.RandomSeed != nil { - v.Writeln("(sgp :seed (%d 0))\n", *v.model.RandomSeed) + if options.RandomSeed != nil { + v.Writeln("(sgp :seed (%d 0))\n", *options.RandomSeed) } // chunks diff --git a/modes/defaultmode/defaultmode.go b/modes/defaultmode/defaultmode.go index be0535e..9e12064 100644 --- a/modes/defaultmode/defaultmode.go +++ b/modes/defaultmode/defaultmode.go @@ -113,7 +113,7 @@ func generateCode(frameworks framework.List, files []string, outputDir string) ( continue } - fileName, err := f.WriteModel(outputDir, framework.InitialBuffers{}) + fileName, err := f.WriteModel(outputDir, &model.DefaultParams, framework.InitialBuffers{}) if err != nil { fmt.Println(err.Error()) continue @@ -127,7 +127,8 @@ func generateCode(frameworks framework.List, files []string, outputDir string) ( func runCode(frameworks framework.List) { for _, f := range frameworks { - result, err := f.Run(framework.InitialBuffers{}) + model := f.Model() + result, err := f.Run(&model.DefaultParams, framework.InitialBuffers{}) if err != nil { fmt.Println(err.Error()) continue diff --git a/modes/shell/shell.go b/modes/shell/shell.go index 84dab25..d999120 100644 --- a/modes/shell/shell.go +++ b/modes/shell/shell.go @@ -264,7 +264,7 @@ func (s *Shell) cmdRun(initialGoal string) (err error) { "goal": strings.TrimSpace(initialGoal), } - result, err := f.Run(initialBuffers) + result, err := f.Run(&s.currentModel.DefaultParams, initialBuffers) if err != nil { return err } diff --git a/modes/web/model.go b/modes/web/model.go index 9c59cb3..0893cb3 100644 --- a/modes/web/model.go +++ b/modes/web/model.go @@ -83,10 +83,10 @@ func (w *Web) loadModel(sessionID int, amodFile string) (model *Model, err error return } -// actrOptionsFromJSON converts runOptionsJSON into actr.Options -func (w Web) actrOptionsFromJSON(options *runOptionsJSON) (runoptions.Options, error) { +// actrOptionsFromJSON converts runOptionsJSON into actr.Options. It defaults to the model's defaults. +func (w Web) actrOptionsFromJSON(defaults *runoptions.Options, options *runOptionsJSON) (*runoptions.Options, error) { if options == nil { - return runoptions.Options{}, nil + return nil, nil } activeFrameworkNames := w.settings.Frameworks.Names() @@ -95,13 +95,12 @@ func (w Web) actrOptionsFromJSON(options *runOptionsJSON) (runoptions.Options, e err := options.Frameworks.VerifyFrameworkList(activeFrameworkNames) if err != nil { - return runoptions.Options{}, err + return nil, err } - opts := runoptions.New() + opts := *defaults opts.Frameworks = options.Frameworks - opts.RandomSeed = options.RandomSeed if options.LogLevel != nil { opts.LogLevel = runoptions.ACTRLogLevel(*options.LogLevel) @@ -111,7 +110,9 @@ func (w Web) actrOptionsFromJSON(options *runOptionsJSON) (runoptions.Options, e opts.TraceActivations = *options.TraceActivations } - return opts, nil + opts.RandomSeed = options.RandomSeed + + return &opts, nil } func generateModel(amodFile string) (model *actr.Model, err error) { diff --git a/modes/web/session.go b/modes/web/session.go index 2d0cab1..21070e8 100644 --- a/modes/web/session.go +++ b/modes/web/session.go @@ -67,14 +67,12 @@ func (w *Web) runModelSessionHandler(rw http.ResponseWriter, req *http.Request) return } - aoptions, err := w.actrOptionsFromJSON(&data.Options) + aoptions, err := w.actrOptionsFromJSON(&model.actrModel.DefaultParams, &data.Options) if err != nil { encodeErrorResponse(rw, err) return } - model.actrModel.Options = aoptions - // ensure temp dir exists // https://github.com/asmaloney/gactar/issues/103 _, err = cli.CreateTempDir(w.settings) @@ -83,7 +81,7 @@ func (w *Web) runModelSessionHandler(rw http.ResponseWriter, req *http.Request) return } - resultMap := w.runModel(model.actrModel, data.Buffers) + resultMap := w.runModel(model.actrModel, aoptions, data.Buffers) for key := range resultMap { result := resultMap[key] diff --git a/modes/web/web.go b/modes/web/web.go index 88acd66..dc8d43b 100644 --- a/modes/web/web.go +++ b/modes/web/web.go @@ -24,6 +24,7 @@ import ( "github.com/asmaloney/gactar/util/cli" "github.com/asmaloney/gactar/util/issues" + "github.com/asmaloney/gactar/util/runoptions" "github.com/asmaloney/gactar/util/validate" "github.com/asmaloney/gactar/util/version" ) @@ -162,14 +163,12 @@ func (w Web) runModelHandler(rw http.ResponseWriter, req *http.Request) { return } - aoptions, err := w.actrOptionsFromJSON(data.Options) + aoptions, err := w.actrOptionsFromJSON(&model.DefaultParams, data.Options) if err != nil { encodeErrorResponse(rw, err) return } - model.Options = aoptions - initialGoal := strings.TrimSpace(data.Goal) initialBuffers := framework.InitialBuffers{ "goal": initialGoal, @@ -185,7 +184,7 @@ func (w Web) runModelHandler(rw http.ResponseWriter, req *http.Request) { return } - resultMap := w.runModel(model, initialBuffers) + resultMap := w.runModel(model, aoptions, initialBuffers) rr := runResult{ Issues: log.AllIssues(), @@ -201,13 +200,13 @@ func (w Web) runModelHandler(rw http.ResponseWriter, req *http.Request) { encodeResponse(rw, json.RawMessage(string(results))) } -func (w Web) runModel(model *actr.Model, initialBuffers framework.InitialBuffers) (resultMap frameworkRunResultMap) { - resultMap = make(frameworkRunResultMap, len(model.Options.Frameworks)) +func (w Web) runModel(model *actr.Model, options *runoptions.Options, initialBuffers framework.InitialBuffers) (resultMap frameworkRunResultMap) { + resultMap = make(frameworkRunResultMap, len(options.Frameworks)) var wg sync.WaitGroup var mutex = &sync.Mutex{} - for _, name := range model.Options.Frameworks { + for _, name := range options.Frameworks { f := w.settings.Frameworks[name] wg.Add(1) @@ -219,7 +218,7 @@ func (w Web) runModel(model *actr.Model, initialBuffers framework.InitialBuffers log := f.ValidateModel(model) if !log.HasError() { - r, err := runModelOnFramework(model, initialBuffers, f) + r, err := runModelOnFramework(model, options, initialBuffers, f) if err != nil { log.Error(nil, err.Error()) } @@ -264,7 +263,7 @@ func (w Web) runModel(model *actr.Model, initialBuffers framework.InitialBuffers return } -func runModelOnFramework(model *actr.Model, initialBuffers framework.InitialBuffers, f framework.Framework) (result *framework.RunResult, err error) { +func runModelOnFramework(model *actr.Model, options *runoptions.Options, initialBuffers framework.InitialBuffers, f framework.Framework) (result *framework.RunResult, err error) { if model == nil { err = ErrNoModel return @@ -275,7 +274,7 @@ func runModelOnFramework(model *actr.Model, initialBuffers framework.InitialBuff return } - result, err = f.Run(initialBuffers) + result, err = f.Run(options, initialBuffers) if err != nil { return } diff --git a/util/runoptions/runoptions.go b/util/runoptions/runoptions.go index 5cb34d2..a2f7346 100644 --- a/util/runoptions/runoptions.go +++ b/util/runoptions/runoptions.go @@ -37,7 +37,7 @@ type Options struct { // One of 'min', 'info', or 'detail' LogLevel ACTRLogLevel - // Output detailed info about activations + // If true, output detailed info about activations TraceActivations bool // The seed to use for generating pseudo-random numbers (allows for reproducible runs)