summaryrefslogtreecommitdiff
path: root/src/Mind.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mind.hs')
-rw-r--r--src/Mind.hs27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/Mind.hs b/src/Mind.hs
index 02b98b1..45b90da 100644
--- a/src/Mind.hs
+++ b/src/Mind.hs
@@ -1,11 +1,30 @@
module Mind
( NeuronIndex (..)
, getNeuronIndex
+
+ , Edge (..)
+
+ , Network (..)
+ , createEmptyNetwork
) where
--- types
-data NeuronIndex = Input Int | Internal Int | Output Int
+-- index different neuron types
+data NeuronIndex = Input Int | Internal Int | Output Int deriving (Show, Eq)
+
getNeuronIndex :: NeuronIndex -> Int
-getNeuronIndex i = undefined
+getNeuronIndex (Input i) = i
+getNeuronIndex (Internal i) = i
+getNeuronIndex (Output i) = i
+
+-- define incident edges
+newtype Edge = Edge (NeuronIndex, Float) deriving (Show, Eq)
+
+-- define networks
+data Network = Network
+ { numInput :: Int
+ , internalNeurons :: [[Edge]]
+ , outputNeurons :: [[Edge]]
+ } deriving (Show, Eq)
-newtype Edge = Edge (NeuronIndex, Float)
+createEmptyNetwork :: Int -> Int -> Int -> Network
+createEmptyNetwork i h o = Network i (replicate h []) (replicate o [])