ACT-R-Client 7.11.1-beta1

This is a prerelease version of ACT-R-Client.
dotnet add package ACT-R-Client --version 7.11.1-beta1
NuGet\Install-Package ACT-R-Client -Version 7.11.1-beta1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ACT-R-Client" Version="7.11.1-beta1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ACT-R-Client --version 7.11.1-beta1
#r "nuget: ACT-R-Client, 7.11.1-beta1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ACT-R-Client as a Cake Addin
#addin nuget:?package=ACT-R-Client&version=7.11.1-beta1&prerelease

// Install ACT-R-Client as a Cake Tool
#tool nuget:?package=ACT-R-Client&version=7.11.1-beta1&prerelease

ACT-R-Client (under development)

This library makes an ACT-R Client available for .NET (>= 4.5) projects. It needs ACT-R Version 7.6 (currently in beta) or higher since this is the first version with the new JSON-RPC interface called dispatcher. I highly recommend to read the ACT-R RPC Interface Documentation for a better understandig how the ACT-R dispatcher works.

How to use the ACT-R Client

You can install the library to your project via Nuget:

Install-Package ACT-R-Client

Afterwards you can create an ActRClient object:

// since ActRClient implements IDisposal it can be used in an using block
using (ActRClient actr = new ActRClient("127.0.0.1", 2650)) // change host and port to your needs
{
  // do what you need to do
}

With this object you can interact with the ACT-R dispatcher.

Add / Remove Command to the dispatcher

For adding commands to the dispatcher you have to create an AbstractAddCommandRequest instance and send it to the dispatcher:

// add command
AbstractAddCommandRequest addCommandRequest = new AddCommandRequest(KeyPressAction, "published-name",
  "private-name", "Documentation");
actr.AddDispatcherCommand(addCommandRequest);

// remove command
actr.RemoveDispatcherCommand(addCommandRequest);
// or
actr.RemoveDispatcherCommand("private-name");

The AddCommandRequest is a implementation of the abstract class AbstractAddCommandRequest, which uses a simple delegate for command evaluations. Of course you can implement your own AbstractAddCommandRequest class to handle the evaluation requests from the dispatcher as you want to.

Add / Remove Monitor to the dispatcher

Adding a command monitor is very similar to adding a command:

// add monitor
MonitorRequest dispatcherMonitor = new MonitorRequest("command-to-monitor", "command-to-call");
actr.AddDispatcherMonitor(dispatcherMonitor);

//remove monitor
actr.RemoveDispatcherMonitor(dispatcherMonitor);
// or
actr.RemoveDispatcherMonitor("command-to-monitor", "command-to-call");

Evaluate a command by the dispatcher

There are about 100 implemented "ready to use" methods for the most common ACT-R functions, like load-act-r-model, reset, run, ...

// load model
actr.LoadActrModel("ACT-R:tutorial;unit2;demo2-model.lisp");
// reset ACT-R scheduler and model
actr.Reset();
// open experiment window
Window window = actr.OpenExpWindow("Letter difference", true);
// add text to experiment window
actr.AddTextToWindow(window, "A", 125, 150);
// install device
actr.InstallDevice(window);
// run model
actr.Run(10, true);

At the moment only a few are tested, so erros can be occure (please let me know if you found one and i will fix it). If you want to make a different request you have to implement the abstract class AbstractEvaluationRequest, adding all necessary parameter to the given parameterList within the AddParameterToList method. This AbstractEvaluationRequest can then be send to the dispatcher.

// example AbstractEvaluationRequest implementation for the "my-command"
public class MyCommand : AbstractEvaluationRequest
{
  public MyCommand(int intPara, bool boolPara, string stringPara, string model = null) : base("my-command", model)
  {
    IntPara = intPara;
    BoolPara = boolPara;
    StringPara = stringPara;
  }
  public int IntPara { set; get; }
  public bool BoolPara { set; get; }
  public string StringPara { set; get; }

  public override void AddParameterToList(List<object> parameterList)
  {
    parameterList.Add(IntPara);
    parameterList.Add(BoolPara);
    parameterList.Add(StringPara);
  }
}

// let the dispatcher evaluate my-command
AbstractEvaluationRequest myCommandRequest = new MyCommand(0, false, "StringParameter");
Result result = SendEvaluationRequest(myCommandRequest);

Example

The Example Project contains some implementations of the ACT-R tutorials.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.11.1-beta1 743 9/11/2018
7.6.1-beta3 840 6/30/2018
7.6.1-beta2 822 6/19/2018
7.6.1-beta1 732 6/4/2018

Beta release