ACT-R-Client
7.6.1-beta2
See the version list below for details.
dotnet add package ACT-R-Client --version 7.6.1-beta2
NuGet\Install-Package ACT-R-Client -Version 7.6.1-beta2
<PackageReference Include="ACT-R-Client" Version="7.6.1-beta2" />
paket add ACT-R-Client --version 7.6.1-beta2
#r "nuget: ACT-R-Client, 7.6.1-beta2"
// Install ACT-R-Client as a Cake Addin #addin nuget:?package=ACT-R-Client&version=7.6.1-beta2&prerelease // Install ACT-R-Client as a Cake Tool #tool nuget:?package=ACT-R-Client&version=7.6.1-beta2&prerelease
ACT-R-Client (under development)
This library makes an ACT-R Client available for .NET (>= 3.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 BaseParameterList within the ToParameterArray 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 object[] ToParameterArray()
{
var list = BaseParameterList();
list.Add(IntPara);
list.Add(BoolPara);
list.Add(StringPara);
return list.ToArray();
}
}
// 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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net35 is compatible. net40 was computed. net403 was computed. net45 was computed. 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. |
-
- TaskParallelLibrary (>= 1.0.2856)
- Unity.Newtonsoft.Json (>= 7.0.0)
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 | 775 | 9/11/2018 |
7.6.1-beta3 | 850 | 6/30/2018 |
7.6.1-beta2 | 829 | 6/19/2018 |
7.6.1-beta1 | 739 | 6/4/2018 |
Beta release