diff --git a/Math.hs b/Math.hs index cb4c3f8..1b5e125 100644 --- a/Math.hs +++ b/Math.hs @@ -58,7 +58,12 @@ atom = number :: P.Parser Value number = do + n <- numberLiteral + return (Lit n) + +numberLiteral :: P.Parser Lit +numberLiteral = do digits <- P.many1 P.digit let n = foldl (\x d -> 10 * x + toInteger (digitToInt d)) 0 digits ws - return (Lit (Num n)) + return (Num n) diff --git a/Parser.hs b/Parser.hs index 6fa662d..e1863ae 100644 --- a/Parser.hs +++ b/Parser.hs @@ -38,6 +38,7 @@ parseTla a = do f <- readFile a return (left show e) parseState s = parse action ("Error parsing " ++ s ++ ":") s +parseValue s = parse value ("Error parsing " ++ s ++ ":") s parseTrace t = parse trace ("Error parsing " ++ t ++ ":") t @@ -323,7 +324,7 @@ value = do try $ do string "Cardinality(" <|> do try $ do {e <- arithmeticExpression; ws; return (e)} <|> - do {literal;} + do {l <- lit; return (Lit l)} set = do try $ do {s1 <- atomSet; string "\\cup"; ws; s2 <- set; ws; return (Union s1 s2)} <|> @@ -371,6 +372,12 @@ record = do try $ do char '[' char ']' ws return (Record ms) + <|> + do try $ do char '(' + ms <- recEntry `sepBy` try (string "@@ ") + char ')' + ws + return (Record ms) <|> do char '[' i <- identifier @@ -388,6 +395,23 @@ record = do try $ do char '[' ws return (Except i [(Ref k, v)]) -literal = do try $ do {char '\"'; cs <- many1 (noneOf reserved); char '\"'; ws; return (Lit (Str cs))} +recEntry = do try $ do l <- lit + ws + string ":>" + ws + a <- lit + ws + return (Key l, (Lit a)) + +lit = do try $ do stringLiteral + <|> + do try $ do numberLiteral + <|> + do try $ do {string "TRUE"; return (Boolean True)} + <|> + do try $ do {string "FALSE"; return (Boolean False)} + +stringLiteral = do try $ do {char '\"'; cs <- many1 (noneOf reserved); char '\"'; ws; return (Str cs)} +literal = do try $ do {s <- stringLiteral; return (Lit s)} arithmeticExpression = Math.build diff --git a/StateGraphParser.hs b/StateGraphParser.hs index c174f6f..7c89902 100644 --- a/StateGraphParser.hs +++ b/StateGraphParser.hs @@ -7,6 +7,7 @@ import Data.List import GHC.Generics import System.Environment +import Head as H import Elixir import Helpers import Parser @@ -83,9 +84,15 @@ findNode ns n = toMap :: Node -> Either String String toMap Node {nodeId = _, label = l} = case parseState (unescape l) of - Right a -> Right (initialState [] a) + Right a -> Right (initialState [] (toValue a)) Left e -> Left (show e) +toValue :: H.Action -> H.Value +toValue (H.ActionAnd as) = H.And (map toValue as) +toValue (H.Condition v) = v +toValue (H.ActionCall i ps) = H.ConditionCall i ps +toValue a = error("Not a value: " ++ show a) + unescape :: String -> String unescape [] = [] unescape [s] = [s] diff --git a/elixir/test/generated_code/apaew_d80_test.exs b/elixir/test/generated_code/apaew_d80_test.exs new file mode 100644 index 0000000..e426704 --- /dev/null +++ b/elixir/test/generated_code/apaew_d80_test.exs @@ -0,0 +1,3816 @@ +defmodule APAEWD80Test do + use ExUnit.Case + doctest APAEWD80 +test "fromState 8" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 9" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 10" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 11" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 12" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 13" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 14" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 15" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 16" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 17" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 18" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 19" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 20" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 21" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 22" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 23" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 24" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 25" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 26" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 27" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 28" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 29" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 30" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 31" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 32" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 33" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 34" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 35" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 36" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 37" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 38" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 39" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 40" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 41" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 42" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 43" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 44" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 45" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 46" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 47" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 48" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 49" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 50" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 51" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 52" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 53" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 54" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 55" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 56" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 57" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 58" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 59" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 60" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 61" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 62" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 63" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 64" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 65" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 66" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 67" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 68" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 69" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 70" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 71" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 72" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 73" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 74" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 75" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 76" do + variables = %{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 77" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 78" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 79" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 80" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 81" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 82" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 83" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 84" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 85" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 86" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 87" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 88" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 89" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 90" do + variables = %{ + tpos: 2, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 91" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 92" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 93" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 94" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 95" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 96" do + variables = %{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "black", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: true, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}, +%{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 97" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "black", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +}] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 98" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "white", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 99" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "white", Num 1: "black", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 100" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: true, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 101" do + variables = %{ + tpos: 0, + active: %{ Num 0: true, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 102" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 103" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 104" do + variables = %{ + tpos: 0, + active: %{ Num 0: false, Num 1: false, Num 2: false }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "white", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +test "fromState 105" do + variables = %{ + tpos: 1, + active: %{ Num 0: false, Num 1: false, Num 2: true }, + tcolor: "white", + color: %{ Num 0: "black", Num 1: "black", Num 2: "white" } +} + + expectedStates = [] + + actions = APAEWD80.next(variables) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +end \ No newline at end of file