34 |
|
|
35 |
*) |
*) |
36 |
|
|
37 |
#use "Env.ml" |
class type patternType = |
38 |
|
object |
39 |
|
method getInputs : float array array |
40 |
|
method getOutputs : float array array |
41 |
|
method getInput : int -> float array |
42 |
|
method getOutput : int -> float array |
43 |
|
method getVectorNumber : int |
44 |
|
method getInputSize : int |
45 |
|
method getOutputSize : int |
46 |
|
end |
47 |
|
|
48 |
class pattern(inputVector, outputVector) = |
class pattern (inputVector, outputVector) : patternType = |
49 |
object |
object |
50 |
val mutable _inputs = inputVector |
val mutable _inputs = inputVector |
51 |
val mutable _outputs = outputVector |
val mutable _outputs = outputVector |
55 |
| _, _ -> (getEnv())#toChannel "Class Pattern : The input and output are empty.\n" |
| _, _ -> (getEnv())#toChannel "Class Pattern : The input and output are empty.\n" |
56 |
|
|
57 |
method getInputs = _inputs |
method getInputs = _inputs |
|
|
|
58 |
method getOutputs = _outputs |
method getOutputs = _outputs |
|
|
|
59 |
method getInput index = _inputs.(index) |
method getInput index = _inputs.(index) |
|
|
|
60 |
method getOutput index = _outputs.(index) |
method getOutput index = _outputs.(index) |
|
|
|
61 |
method getVectorNumber = Array.length _inputs |
method getVectorNumber = Array.length _inputs |
|
|
|
62 |
method getInputSize = Array.length _inputs.(0) |
method getInputSize = Array.length _inputs.(0) |
63 |
|
method getOutputSize = Array.length _outputs.(0) |
64 |
end |
end |