public void Before() { TuringMachineProperties props = new TuringMachineProperties { M = 5, N = -1, ShiftLength = 3, ShiftMode = ShiftMode.Multiple, Enabled = true, Heads = 1 }; int vectorSize = 2; int startAndDelimiter = 2; int interp = 1; int contentJump = 1; int shift = 3; BlackBoxDummy blackBoxDummy = new BlackBoxDummy(vectorSize + startAndDelimiter + props.M, // input 4 environment + 5 turing machine = 9 vectorSize + props.M + interp + contentJump + shift); // output = 2 environment + 10 turing machine = 12 double[][] outputValues = { new double[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} }; _controller = new TuringController(props); _controller.Phenome = blackBoxDummy; }
// Number of times each location was accessed during livetime of the tm // private List<int> _writeActivities = new List<int>(); // private List<int> _readActivities = new List<int>(); public MinimalTuringMachine(TuringMachineProperties props) { _enabled = props.Enabled; _m = props.M; _n = props.N; _heads = props.Heads; _shiftLength = props.ShiftLength; _shiftMode = props.ShiftMode; _writeMode = props.WriteMode; _minSimilarityToJump = props.MinSimilarityToJump; _tape = new List <double[]>(); _initalizeWithGradient = props.InitalizeWithGradient; _initalValue = props.InitalValue; _didWriteThreshold = props.DidWriteThreshold; _useMemoryExpandLocation = props.UseMemoryExpandLocation; Reset(); _initialRead = new double[_heads][]; for (int i = 0; i < _heads; i++) { _initialRead[i] = GetRead(i); } }
public TuringController(TuringMachineProperties props) { TuringMachine = new MinimalTuringMachine(props); _turingInputLength = TuringMachine.InputCount; }
public override void Initialize(XmlElement xmlConfig) { _turingMachineProps = new TuringMachineProperties(xmlConfig.SelectSingleNode("TuringMachineParams") as XmlElement); }