diff --git a/ConfigParser.hs b/ConfigParser.hs index 9b4bd07..c93157e 100644 --- a/ConfigParser.hs +++ b/ConfigParser.hs @@ -43,3 +43,6 @@ parseConfig file = do return (eitherDecode content) -- main :: IO () -- main = parseJson jsonFile >>= print + +processNames :: DistributionConfig -> [String] +processNames (Config ps _) = map (\(PConfig n _) -> n) ps diff --git a/Elixir.hs b/Elixir.hs index 5fdc91a..96b87f7 100644 --- a/Elixir.hs +++ b/Elixir.hs @@ -146,7 +146,7 @@ listActions :: Context -> [Action] -> ElixirCode listActions _ [] = "" listActions g as = let infos = map (actionInfo g) as - in "List.flatten([\n" ++ ident (intercalate ",\n" infos) ++ "\n])\n" + in "Enum.filter(\n List.flatten([\n" ++ ident (intercalate ",\n" infos) ++ "\n]),\n fn(action) -> action[:condition] end\n)" -- decide :: Context -> [Action] -> ElixirCode -- decide _ [] = "" @@ -295,7 +295,7 @@ actionInfo g a = caseMatch g (Match p v) = value g p ++ " -> " ++ value g v caseMatch g (DefaultMatch v) = "true -> " ++ value g v -mapping g ((Key i), v) = show i ++ ": " ++ value g v +mapping g ((Key i), v) = lit i ++ " => " ++ value g v mapping g ((All i a), v) = let ig = (i, "param") : g in value g a ++ " |> Enum.map(fn (" ++ i ++ ") -> {" ++ i ++ ", " ++ value ig v ++ "} end)" diff --git a/Snippets.hs b/Snippets.hs index ff6d350..91d5add 100644 --- a/Snippets.hs +++ b/Snippets.hs @@ -4,24 +4,23 @@ decideAction = unlines [ "" , "def decide_action(oracle, actions, step) do" - , " possible_actions = Enum.filter(actions, fn(action) -> action[:condition] end)" - , " different_states = Enum.uniq_by(possible_actions, fn(action) -> action[:state] end)" + , " different_states = Enum.uniq_by(actions, fn(action) -> action[:state] end)" , "" , " cond do" , " Enum.count(different_states) == 1 ->" - , " Enum.at(possible_actions, 0)[:state]" + , " Enum.at(actions, 0)[:state]" , " Enum.empty?(different_states) ->" , " IO.puts(\"DEADLOCK\")" , " exit(0)" , " true ->" - , " send oracle, {:choose, self(), possible_actions}" + , " send oracle, {:choose, self(), actions}" , "" , " n = receive do" , " {:ok, n} -> n" , " {:stop} -> exit(0)" , " end" , "" - , " Enum.at(possible_actions, n)[:state]" + , " Enum.at(actions, n)[:state]" , " end" , "end" ] diff --git a/StateGraphParser.hs b/StateGraphParser.hs index 7c89902..e081288 100644 --- a/StateGraphParser.hs +++ b/StateGraphParser.hs @@ -11,6 +11,7 @@ import Head as H import Elixir import Helpers import Parser +import ConfigParser getJSON :: FilePath -> IO B.ByteString getJSON = B.readFile @@ -45,14 +46,14 @@ instance FromJSON Node where instance FromJSON Edge where parseJSON (Object v) = Edge <$> v .: "tail" <*> v .: "head" -genTests :: String -> Graph -> Either String String -genTests m Graph {nodes = ns, edges = es} = - case traverse (testForNode m (Graph ns es)) ns of +genTests :: String -> [String] -> Graph -> Either String String +genTests m ms Graph {nodes = ns, edges = es} = + case traverse (testForNode (map ((m ++ "_") ++) ms) (Graph ns es)) ns of Right ts -> Right (header m ++ intercalate "\n" ts ++ "\nend") Left e -> Left e -testForNode :: String -> Graph -> Node -> Either String String -testForNode m g Node {nodeId = i, label = l} = do +testForNode :: [String] -> Graph -> Node -> Either String String +testForNode ms g Node {nodeId = i, label = l} = do vs <- toMap Node {nodeId = i, label = l} ss <- statesFromId g i >>= traverse toMap return @@ -62,7 +63,7 @@ testForNode m g Node {nodeId = i, label = l} = do , "" , " expectedStates = [" ++ intercalate ",\n" ss ++ "]" , "" - , " actions = " ++ m ++ ".next(variables)" + , " actions = List.flatten([" ++ intercalate ", " (map (++ ".next(variables)") ms) ++ "])" , " states = Enum.map(actions, fn action -> action[:state] end)" , "" , " assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates))" @@ -71,7 +72,7 @@ testForNode m g Node {nodeId = i, label = l} = do statesFromId :: Graph -> Integer -> Either String [Node] statesFromId Graph {nodes = ns, edges = es} i = - let edgesFromId = filter (\Edge {nodeFrom = f, nodeTo = t} -> f == i) es + let edgesFromId = filter (\Edge {nodeFrom = f, nodeTo = _} -> f == i) es nodesIdsFromId = map (\Edge {nodeFrom = _, nodeTo = t} -> t) edgesFromId in traverse (findNode ns) nodesIdsFromId @@ -108,13 +109,16 @@ header m = unlines ["defmodule " ++ m ++ "Test do", " use ExUnit.Case", " doct main :: IO () main = do - (moduleName:file:_) <- getArgs + (moduleName:file:configFile:_) <- getArgs + config <- parseConfig configFile d <- (eitherDecode <$> getJSON file) :: IO (Either String Graph) case d of Left err -> putStrLn err Right ps -> - case genTests moduleName ps of + case fmap processNames config of Left err -> putStrLn err - Right s -> - let f = "elixir/test/generated_code/" ++ snake moduleName ++ "_test.exs" - in writeFile f s + Right ms -> case genTests moduleName ms ps of + Left err -> putStrLn err + Right s -> + let f = "elixir/test/generated_code/" ++ snake moduleName ++ "_test.exs" + in writeFile f s diff --git a/elixir/lib/generated_code/apaew_d840_node0.ex b/elixir/lib/generated_code/apaew_d840_node0.ex index 6428899..165eabb 100644 --- a/elixir/lib/generated_code/apaew_d840_node0.ex +++ b/elixir/lib/generated_code/apaew_d840_node0.ex @@ -4,14 +4,17 @@ defmodule APAEWD840_node0 do import APAEWD840 def next(variables) do - List.flatten([ + Enum.filter( + List.flatten([ %{ action: "InitiateProbe()", condition: initiate_probe_condition(variables), state: initiate_probe(variables) }, Enum.map(MapSet.new([1, 2]), fn (i) -> [ %{ action: "SendMsg(Lit (Num 0), #{inspect i})", condition: send_msg_condition(variables, 0, i), state: send_msg(variables, 0, i) } ] end ), %{ action: "Deactivate(Lit (Num 0))", condition: deactivate_condition(variables, 0), state: deactivate(variables, 0) } - ]) + ]), + fn(action) -> action[:condition] end + ) end def main(oracle, private_variables, step) do @@ -29,24 +32,23 @@ defmodule APAEWD840_node0 do end def decide_action(oracle, actions, step) do - possible_actions = Enum.filter(actions, fn(action) -> action[:condition] end) - different_states = Enum.uniq_by(possible_actions, fn(action) -> action[:state] end) + different_states = Enum.uniq_by(actions, fn(action) -> action[:state] end) cond do Enum.count(different_states) == 1 -> - Enum.at(possible_actions, 0)[:state] + Enum.at(actions, 0)[:state] Enum.empty?(different_states) -> IO.puts("DEADLOCK") exit(0) true -> - send oracle, {:choose, self(), possible_actions} + send oracle, {:choose, self(), actions} n = receive do {:ok, n} -> n {:stop} -> exit(0) end - Enum.at(possible_actions, n)[:state] + Enum.at(actions, n)[:state] end end def wait_lock(oracle) do diff --git a/elixir/lib/generated_code/apaew_d840_node1.ex b/elixir/lib/generated_code/apaew_d840_node1.ex index f2257b0..0724311 100644 --- a/elixir/lib/generated_code/apaew_d840_node1.ex +++ b/elixir/lib/generated_code/apaew_d840_node1.ex @@ -4,14 +4,17 @@ defmodule APAEWD840_node1 do import APAEWD840 def next(variables) do - List.flatten([ + Enum.filter( + List.flatten([ %{ action: "PassToken(Lit (Num 1))", condition: pass_token_condition(variables, 1), state: pass_token(variables, 1) }, Enum.map(MapSet.new([0, 2]), fn (i) -> [ %{ action: "SendMsg(Lit (Num 1), #{inspect i})", condition: send_msg_condition(variables, 1, i), state: send_msg(variables, 1, i) } ] end ), %{ action: "Deactivate(Lit (Num 1))", condition: deactivate_condition(variables, 1), state: deactivate(variables, 1) } - ]) + ]), + fn(action) -> action[:condition] end + ) end def main(oracle, private_variables, step) do @@ -29,24 +32,23 @@ defmodule APAEWD840_node1 do end def decide_action(oracle, actions, step) do - possible_actions = Enum.filter(actions, fn(action) -> action[:condition] end) - different_states = Enum.uniq_by(possible_actions, fn(action) -> action[:state] end) + different_states = Enum.uniq_by(actions, fn(action) -> action[:state] end) cond do Enum.count(different_states) == 1 -> - Enum.at(possible_actions, 0)[:state] + Enum.at(actions, 0)[:state] Enum.empty?(different_states) -> IO.puts("DEADLOCK") exit(0) true -> - send oracle, {:choose, self(), possible_actions} + send oracle, {:choose, self(), actions} n = receive do {:ok, n} -> n {:stop} -> exit(0) end - Enum.at(possible_actions, n)[:state] + Enum.at(actions, n)[:state] end end def wait_lock(oracle) do diff --git a/elixir/lib/generated_code/apaew_d840_node2.ex b/elixir/lib/generated_code/apaew_d840_node2.ex index 6b92113..7c18773 100644 --- a/elixir/lib/generated_code/apaew_d840_node2.ex +++ b/elixir/lib/generated_code/apaew_d840_node2.ex @@ -4,14 +4,17 @@ defmodule APAEWD840_node2 do import APAEWD840 def next(variables) do - List.flatten([ + Enum.filter( + List.flatten([ %{ action: "PassToken(Lit (Num 2))", condition: pass_token_condition(variables, 2), state: pass_token(variables, 2) }, Enum.map(MapSet.new([0, 1]), fn (i) -> [ %{ action: "SendMsg(Lit (Num 2), #{inspect i})", condition: send_msg_condition(variables, 2, i), state: send_msg(variables, 2, i) } ] end ), %{ action: "Deactivate(Lit (Num 2))", condition: deactivate_condition(variables, 2), state: deactivate(variables, 2) } - ]) + ]), + fn(action) -> action[:condition] end + ) end def main(oracle, private_variables, step) do @@ -29,24 +32,23 @@ defmodule APAEWD840_node2 do end def decide_action(oracle, actions, step) do - possible_actions = Enum.filter(actions, fn(action) -> action[:condition] end) - different_states = Enum.uniq_by(possible_actions, fn(action) -> action[:state] end) + different_states = Enum.uniq_by(actions, fn(action) -> action[:state] end) cond do Enum.count(different_states) == 1 -> - Enum.at(possible_actions, 0)[:state] + Enum.at(actions, 0)[:state] Enum.empty?(different_states) -> IO.puts("DEADLOCK") exit(0) true -> - send oracle, {:choose, self(), possible_actions} + send oracle, {:choose, self(), actions} n = receive do {:ok, n} -> n {:stop} -> exit(0) end - Enum.at(possible_actions, n)[:state] + Enum.at(actions, n)[:state] end end def wait_lock(oracle) do diff --git a/elixir/test/generated_code/apaew_d80_test.exs b/elixir/test/generated_code/apaew_d80_test.exs deleted file mode 100644 index e426704..0000000 --- a/elixir/test/generated_code/apaew_d80_test.exs +++ /dev/null @@ -1,3816 +0,0 @@ -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 diff --git a/elixir/test/generated_code/apaew_d840_test.exs b/elixir/test/generated_code/apaew_d840_test.exs new file mode 100644 index 0000000..d5dc271 --- /dev/null +++ b/elixir/test/generated_code/apaew_d840_test.exs @@ -0,0 +1,3817 @@ +defmodule APAEWD840Test do + use ExUnit.Case + doctest APAEWD840 +test "fromState 8" do + variables = %{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [%{ + tpos: 2, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "black", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => true, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}, +%{ + tpos: 1, + active: %{ 0 => true, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [%{ + tpos: 0, + active: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "black", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +}] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "white", 1 => "white", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "white", 1 => "black", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => true, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => true, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.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: %{ 0 => false, 1 => false, 2 => false }, + tcolor: "white", + color: %{ 0 => "black", 1 => "white", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) + IO.inspect(actions) + 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: %{ 0 => false, 1 => false, 2 => true }, + tcolor: "white", + color: %{ 0 => "black", 1 => "black", 2 => "white" } +} + + expectedStates = [] + + actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:state] end) + + assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) +end + +end diff --git a/elixir/test/generated_code/two_phase_commit_test.exs b/elixir/test/generated_code/two_phase_commit_test.exs deleted file mode 100644 index 1780790..0000000 --- a/elixir/test/generated_code/two_phase_commit_test.exs +++ /dev/null @@ -1,1736 +0,0 @@ -defmodule TwoPhaseCommitTest do - use ExUnit.Case - doctest TwoPhaseCommit -test "fromState 9" do - variables = %{ - msgs: MapSet.new([]), - rm_state: %{ r1: "working", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "working", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 10" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "working", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 11" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 12" do - variables = %{ - msgs: MapSet.new([]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 13" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 14" do - variables = %{ - msgs: MapSet.new([]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 15" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 16" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 17" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 18" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 19" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 20" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 21" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 22" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 23" do - variables = %{ - msgs: MapSet.new([]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 24" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 25" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 26" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 27" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 28" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 29" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 30" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 31" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 32" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 33" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 34" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 35" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 36" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 37" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 38" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 39" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 40" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 41" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "working" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 42" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 43" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 44" do - variables = %{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "init", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 45" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 46" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 47" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "working", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 48" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new([]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 49" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 50" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 51" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 52" do - variables = %{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 53" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 54" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 55" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 56" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 57" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 58" do - variables = %{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 59" do - variables = %{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 60" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "prepared" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 61" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "prepared", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}, -%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 62" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 63" do - variables = %{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Commit" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "committed", r2: "committed" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -test "fromState 64" do - variables = %{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -} - - expectedStates = [%{ - msgs: MapSet.new([%{ type: "Abort" }, %{ type: "Prepared", rm: "r1" }, %{ type: "Prepared", rm: "r2" }]), - rm_state: %{ r1: "aborted", r2: "aborted" }, - tm_state: "done", - tm_prepared: MapSet.new(["r1", "r2"]) -}] - - actions = TwoPhaseCommit.next(variables) - states = Enum.map(actions, fn action -> action[:state] end) - - assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) - assert Enum.all?(actions, fn action -> Enum.member?(expectedStates, action[:state]) end) - assert Enum.all?(expectedStates, fn s -> Enum.member?(states, s) end) -end - -end \ No newline at end of file diff --git a/tla_specifications/ewd840/APAEWD840.cfg b/tla_specifications/ewd840/APAEWD840.cfg index 0f2b2a3..36f7cc2 100644 --- a/tla_specifications/ewd840/APAEWD840.cfg +++ b/tla_specifications/ewd840/APAEWD840.cfg @@ -2,9 +2,9 @@ CONSTANT N = 3 INVARIANTS -Inv PROPERTY +Test INIT Init diff --git a/tla_specifications/ewd840/APAEWD840.tla b/tla_specifications/ewd840/APAEWD840.tla index 6685a70..94443ab 100644 --- a/tla_specifications/ewd840/APAEWD840.tla +++ b/tla_specifications/ewd840/APAEWD840.tla @@ -115,6 +115,8 @@ vars == <> (***************************************************************************) TokenAlwaysBlack == tcolor = "black" +Test == TRUE + NeverChangeColor == [][ UNCHANGED color ]_vars (***************************************************************************) diff --git a/tla_specifications/ewd840/states.json b/tla_specifications/ewd840/states.json index 3fbce61..0e258d9 100644 --- a/tla_specifications/ewd840/states.json +++ b/tla_specifications/ewd840/states.json @@ -498,14 +498,6 @@ } ], "edges": [ - { - "_gvid": 0, - "tail": 8, - "head": 8, - "color": "black", - "fontcolor": "black", - "label": "" - }, { "_gvid": 1, "tail": 8, @@ -530,6 +522,14 @@ "fontcolor": "black", "label": "" }, + { + "_gvid": 0, + "tail": 8, + "head": 8, + "color": "black", + "fontcolor": "black", + "label": "" + }, { "_gvid": 4, "tail": 8, @@ -555,25 +555,25 @@ "label": "" }, { - "_gvid": 7, + "_gvid": 8, "tail": 9, - "head": 9, + "head": 15, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 8, + "_gvid": 9, "tail": 9, - "head": 15, + "head": 16, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 9, + "_gvid": 7, "tail": 9, - "head": 16, + "head": 9, "color": "black", "fontcolor": "black", "label": "" @@ -651,25 +651,17 @@ "label": "" }, { - "_gvid": 19, - "tail": 11, - "head": 8, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 20, + "_gvid": 21, "tail": 11, - "head": 11, + "head": 16, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 21, + "_gvid": 19, "tail": 11, - "head": 16, + "head": 8, "color": "black", "fontcolor": "black", "label": "" @@ -691,17 +683,17 @@ "label": "" }, { - "_gvid": 24, + "_gvid": 20, "tail": 11, - "head": 26, + "head": 11, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 25, - "tail": 12, - "head": 12, + "_gvid": 24, + "tail": 11, + "head": 26, "color": "black", "fontcolor": "black", "label": "" @@ -730,6 +722,14 @@ "fontcolor": "black", "label": "" }, + { + "_gvid": 25, + "tail": 12, + "head": 12, + "color": "black", + "fontcolor": "black", + "label": "" + }, { "_gvid": 29, "tail": 12, @@ -747,9 +747,9 @@ "label": "" }, { - "_gvid": 31, + "_gvid": 34, "tail": 13, - "head": 8, + "head": 18, "color": "black", "fontcolor": "black", "label": "" @@ -763,33 +763,33 @@ "label": "" }, { - "_gvid": 33, + "_gvid": 35, "tail": 13, - "head": 13, + "head": 22, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 34, + "_gvid": 36, "tail": 13, - "head": 18, + "head": 25, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 35, + "_gvid": 33, "tail": 13, - "head": 22, + "head": 13, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 36, + "_gvid": 31, "tail": 13, - "head": 25, + "head": 8, "color": "black", "fontcolor": "black", "label": "" @@ -803,49 +803,49 @@ "label": "" }, { - "_gvid": 38, + "_gvid": 41, "tail": 14, - "head": 10, + "head": 19, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 39, + "_gvid": 42, "tail": 14, - "head": 12, + "head": 23, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 40, + "_gvid": 38, "tail": 14, - "head": 14, + "head": 10, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 41, + "_gvid": 43, "tail": 14, - "head": 19, + "head": 26, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 42, + "_gvid": 40, "tail": 14, - "head": 23, + "head": 14, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 43, + "_gvid": 39, "tail": 14, - "head": 26, + "head": 12, "color": "black", "fontcolor": "black", "label": "" @@ -907,25 +907,25 @@ "label": "" }, { - "_gvid": 51, + "_gvid": 52, "tail": 16, - "head": 16, + "head": 34, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 52, + "_gvid": 53, "tail": 16, - "head": 34, + "head": 35, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 53, + "_gvid": 51, "tail": 16, - "head": 35, + "head": 16, "color": "black", "fontcolor": "black", "label": "" @@ -939,25 +939,25 @@ "label": "" }, { - "_gvid": 55, + "_gvid": 56, "tail": 17, - "head": 17, + "head": 31, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 56, + "_gvid": 57, "tail": 17, - "head": 31, + "head": 34, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 57, + "_gvid": 55, "tail": 17, - "head": 34, + "head": 17, "color": "black", "fontcolor": "black", "label": "" @@ -979,41 +979,41 @@ "label": "" }, { - "_gvid": 60, + "_gvid": 61, "tail": 18, - "head": 9, + "head": 15, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 61, + "_gvid": 63, "tail": 18, - "head": 15, + "head": 32, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 62, + "_gvid": 64, "tail": 18, - "head": 18, + "head": 35, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 63, + "_gvid": 62, "tail": 18, - "head": 32, + "head": 18, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 64, + "_gvid": 60, "tail": 18, - "head": 35, + "head": 9, "color": "black", "fontcolor": "black", "label": "" @@ -1027,33 +1027,25 @@ "label": "" }, { - "_gvid": 66, - "tail": 19, - "head": 15, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 67, + "_gvid": 72, "tail": 19, - "head": 17, + "head": 40, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 68, + "_gvid": 69, "tail": 19, - "head": 19, + "head": 33, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 69, + "_gvid": 66, "tail": 19, - "head": 33, + "head": 15, "color": "black", "fontcolor": "black", "label": "" @@ -1067,25 +1059,25 @@ "label": "" }, { - "_gvid": 71, + "_gvid": 68, "tail": 19, - "head": 39, + "head": 19, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 72, + "_gvid": 67, "tail": 19, - "head": 40, + "head": 17, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 73, - "tail": 20, - "head": 10, + "_gvid": 71, + "tail": 19, + "head": 39, "color": "black", "fontcolor": "black", "label": "" @@ -1099,9 +1091,9 @@ "label": "" }, { - "_gvid": 75, + "_gvid": 73, "tail": 20, - "head": 20, + "head": 10, "color": "black", "fontcolor": "black", "label": "" @@ -1122,6 +1114,14 @@ "fontcolor": "black", "label": "" }, + { + "_gvid": 75, + "tail": 20, + "head": 20, + "color": "black", + "fontcolor": "black", + "label": "" + }, { "_gvid": 78, "tail": 20, @@ -1171,17 +1171,17 @@ "label": "" }, { - "_gvid": 84, + "_gvid": 85, "tail": 22, - "head": 10, + "head": 18, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 85, + "_gvid": 84, "tail": 22, - "head": 18, + "head": 10, "color": "black", "fontcolor": "black", "label": "" @@ -1211,41 +1211,41 @@ "label": "" }, { - "_gvid": 89, + "_gvid": 90, "tail": 23, - "head": 10, + "head": 19, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 90, + "_gvid": 92, "tail": 23, - "head": 19, + "head": 23, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 91, + "_gvid": 89, "tail": 23, - "head": 21, + "head": 10, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 92, + "_gvid": 93, "tail": 23, - "head": 23, + "head": 43, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 93, + "_gvid": 91, "tail": 23, - "head": 43, + "head": 21, "color": "black", "fontcolor": "black", "label": "" @@ -1259,25 +1259,25 @@ "label": "" }, { - "_gvid": 95, + "_gvid": 97, "tail": 24, - "head": 12, + "head": 34, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 96, + "_gvid": 95, "tail": 24, - "head": 24, + "head": 12, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 97, + "_gvid": 96, "tail": 24, - "head": 34, + "head": 24, "color": "black", "fontcolor": "black", "label": "" @@ -1299,9 +1299,9 @@ "label": "" }, { - "_gvid": 100, + "_gvid": 102, "tail": 25, - "head": 11, + "head": 35, "color": "black", "fontcolor": "black", "label": "" @@ -1315,9 +1315,9 @@ "label": "" }, { - "_gvid": 102, + "_gvid": 100, "tail": 25, - "head": 35, + "head": 11, "color": "black", "fontcolor": "black", "label": "" @@ -1331,25 +1331,25 @@ "label": "" }, { - "_gvid": 104, + "_gvid": 106, "tail": 26, - "head": 14, + "head": 36, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 105, + "_gvid": 104, "tail": 26, - "head": 24, + "head": 14, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 106, + "_gvid": 105, "tail": 26, - "head": 36, + "head": 24, "color": "black", "fontcolor": "black", "label": "" @@ -1363,9 +1363,9 @@ "label": "" }, { - "_gvid": 108, + "_gvid": 111, "tail": 27, - "head": 12, + "head": 37, "color": "black", "fontcolor": "black", "label": "" @@ -1379,33 +1379,33 @@ "label": "" }, { - "_gvid": 110, + "_gvid": 112, "tail": 27, - "head": 27, + "head": 44, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 111, + "_gvid": 113, "tail": 27, - "head": 37, + "head": 47, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 112, + "_gvid": 110, "tail": 27, - "head": 44, + "head": 27, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 113, + "_gvid": 108, "tail": 27, - "head": 47, + "head": 12, "color": "black", "fontcolor": "black", "label": "" @@ -1419,49 +1419,49 @@ "label": "" }, { - "_gvid": 115, + "_gvid": 118, "tail": 28, - "head": 12, + "head": 38, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 116, + "_gvid": 119, "tail": 28, - "head": 21, + "head": 45, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 117, + "_gvid": 116, "tail": 28, - "head": 28, + "head": 21, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 118, + "_gvid": 120, "tail": 28, - "head": 38, + "head": 48, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 119, + "_gvid": 117, "tail": 28, - "head": 45, + "head": 28, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 120, + "_gvid": 115, "tail": 28, - "head": 48, + "head": 12, "color": "black", "fontcolor": "black", "label": "" @@ -1475,9 +1475,9 @@ "label": "" }, { - "_gvid": 122, + "_gvid": 124, "tail": 29, - "head": 22, + "head": 39, "color": "black", "fontcolor": "black", "label": "" @@ -1491,9 +1491,9 @@ "label": "" }, { - "_gvid": 124, + "_gvid": 122, "tail": 29, - "head": 39, + "head": 22, "color": "black", "fontcolor": "black", "label": "" @@ -1515,25 +1515,25 @@ "label": "" }, { - "_gvid": 127, + "_gvid": 128, "tail": 30, - "head": 30, + "head": 51, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 128, + "_gvid": 129, "tail": 30, - "head": 51, + "head": 52, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 129, + "_gvid": 127, "tail": 30, - "head": 52, + "head": 30, "color": "black", "fontcolor": "black", "label": "" @@ -1611,25 +1611,25 @@ "label": "" }, { - "_gvid": 139, + "_gvid": 144, "tail": 33, - "head": 15, + "head": 57, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 140, + "_gvid": 141, "tail": 33, - "head": 31, + "head": 33, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 141, + "_gvid": 139, "tail": 33, - "head": 33, + "head": 15, "color": "black", "fontcolor": "black", "label": "" @@ -1643,17 +1643,17 @@ "label": "" }, { - "_gvid": 143, + "_gvid": 140, "tail": 33, - "head": 56, + "head": 31, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 144, + "_gvid": 143, "tail": 33, - "head": 57, + "head": 56, "color": "black", "fontcolor": "black", "label": "" @@ -1691,17 +1691,17 @@ "label": "" }, { - "_gvid": 149, + "_gvid": 150, "tail": 35, - "head": 16, + "head": 18, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 150, + "_gvid": 149, "tail": 35, - "head": 18, + "head": 16, "color": "black", "fontcolor": "black", "label": "" @@ -1715,73 +1715,73 @@ "label": "" }, { - "_gvid": 152, + "_gvid": 155, "tail": 36, - "head": 19, + "head": 61, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 153, + "_gvid": 152, "tail": 36, - "head": 34, + "head": 19, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 154, + "_gvid": 153, "tail": 36, - "head": 60, + "head": 34, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 155, + "_gvid": 154, "tail": 36, - "head": 61, + "head": 60, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 156, + "_gvid": 157, "tail": 37, - "head": 17, + "head": 31, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 157, + "_gvid": 159, "tail": 37, - "head": 31, + "head": 54, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 158, + "_gvid": 160, "tail": 37, - "head": 37, + "head": 58, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 159, + "_gvid": 158, "tail": 37, - "head": 54, + "head": 37, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 160, + "_gvid": 156, "tail": 37, - "head": 58, + "head": 17, "color": "black", "fontcolor": "black", "label": "" @@ -1795,65 +1795,65 @@ "label": "" }, { - "_gvid": 162, + "_gvid": 168, "tail": 38, - "head": 17, + "head": 63, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 163, + "_gvid": 165, "tail": 38, - "head": 31, + "head": 55, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 164, + "_gvid": 163, "tail": 38, - "head": 38, + "head": 31, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 165, + "_gvid": 166, "tail": 38, - "head": 55, + "head": 59, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 166, + "_gvid": 164, "tail": 38, - "head": 59, + "head": 38, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 167, + "_gvid": 162, "tail": 38, - "head": 62, + "head": 17, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 168, + "_gvid": 167, "tail": 38, - "head": 63, + "head": 62, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 169, + "_gvid": 172, "tail": 39, - "head": 32, + "head": 64, "color": "black", "fontcolor": "black", "label": "" @@ -1867,33 +1867,33 @@ "label": "" }, { - "_gvid": 171, + "_gvid": 169, "tail": 39, - "head": 60, + "head": 32, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 172, + "_gvid": 171, "tail": 39, - "head": 64, + "head": 60, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 173, + "_gvid": 174, "tail": 40, - "head": 40, + "head": 57, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 174, + "_gvid": 177, "tail": 40, - "head": 57, + "head": 65, "color": "black", "fontcolor": "black", "label": "" @@ -1907,41 +1907,41 @@ "label": "" }, { - "_gvid": 176, + "_gvid": 173, "tail": 40, - "head": 64, + "head": 40, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 177, + "_gvid": 178, "tail": 40, - "head": 65, + "head": 66, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 178, + "_gvid": 176, "tail": 40, - "head": 66, + "head": 64, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 179, + "_gvid": 180, "tail": 41, - "head": 21, + "head": 34, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 180, + "_gvid": 179, "tail": 41, - "head": 34, + "head": 21, "color": "black", "fontcolor": "black", "label": "" @@ -1971,9 +1971,9 @@ "label": "" }, { - "_gvid": 184, + "_gvid": 186, "tail": 42, - "head": 20, + "head": 35, "color": "black", "fontcolor": "black", "label": "" @@ -1987,9 +1987,9 @@ "label": "" }, { - "_gvid": 186, + "_gvid": 184, "tail": 42, - "head": 35, + "head": 20, "color": "black", "fontcolor": "black", "label": "" @@ -2003,17 +2003,17 @@ "label": "" }, { - "_gvid": 188, + "_gvid": 189, "tail": 43, - "head": 23, + "head": 36, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 189, + "_gvid": 188, "tail": 43, - "head": 36, + "head": 23, "color": "black", "fontcolor": "black", "label": "" @@ -2035,17 +2035,17 @@ "label": "" }, { - "_gvid": 192, + "_gvid": 193, "tail": 44, - "head": 21, + "head": 37, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 193, + "_gvid": 192, "tail": 44, - "head": 37, + "head": 21, "color": "black", "fontcolor": "black", "label": "" @@ -2075,25 +2075,25 @@ "label": "" }, { - "_gvid": 197, + "_gvid": 198, "tail": 45, - "head": 21, + "head": 38, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 198, + "_gvid": 199, "tail": 45, - "head": 38, + "head": 45, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 199, + "_gvid": 197, "tail": 45, - "head": 45, + "head": 21, "color": "black", "fontcolor": "black", "label": "" @@ -2115,9 +2115,9 @@ "label": "" }, { - "_gvid": 202, + "_gvid": 204, "tail": 46, - "head": 22, + "head": 39, "color": "black", "fontcolor": "black", "label": "" @@ -2131,9 +2131,9 @@ "label": "" }, { - "_gvid": 204, + "_gvid": 202, "tail": 46, - "head": 39, + "head": 22, "color": "black", "fontcolor": "black", "label": "" @@ -2147,9 +2147,9 @@ "label": "" }, { - "_gvid": 206, + "_gvid": 208, "tail": 47, - "head": 24, + "head": 58, "color": "black", "fontcolor": "black", "label": "" @@ -2163,9 +2163,9 @@ "label": "" }, { - "_gvid": 208, + "_gvid": 206, "tail": 47, - "head": 58, + "head": 24, "color": "black", "fontcolor": "black", "label": "" @@ -2179,9 +2179,9 @@ "label": "" }, { - "_gvid": 210, + "_gvid": 212, "tail": 48, - "head": 24, + "head": 59, "color": "black", "fontcolor": "black", "label": "" @@ -2195,9 +2195,9 @@ "label": "" }, { - "_gvid": 212, + "_gvid": 210, "tail": 48, - "head": 59, + "head": 24, "color": "black", "fontcolor": "black", "label": "" @@ -2219,9 +2219,9 @@ "label": "" }, { - "_gvid": 215, + "_gvid": 217, "tail": 50, - "head": 44, + "head": 62, "color": "black", "fontcolor": "black", "label": "" @@ -2235,9 +2235,9 @@ "label": "" }, { - "_gvid": 217, + "_gvid": 215, "tail": 50, - "head": 62, + "head": 44, "color": "black", "fontcolor": "black", "label": "" @@ -2283,17 +2283,17 @@ "label": "" }, { - "_gvid": 223, + "_gvid": 224, "tail": 52, - "head": 30, + "head": 32, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 224, + "_gvid": 223, "tail": 52, - "head": 32, + "head": 30, "color": "black", "fontcolor": "black", "label": "" @@ -2307,33 +2307,33 @@ "label": "" }, { - "_gvid": 226, + "_gvid": 229, "tail": 53, - "head": 33, + "head": 75, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 227, + "_gvid": 226, "tail": 53, - "head": 51, + "head": 33, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 228, + "_gvid": 227, "tail": 53, - "head": 74, + "head": 51, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 229, + "_gvid": 228, "tail": 53, - "head": 75, + "head": 74, "color": "black", "fontcolor": "black", "label": "" @@ -2371,9 +2371,9 @@ "label": "" }, { - "_gvid": 234, + "_gvid": 238, "tail": 55, - "head": 31, + "head": 77, "color": "black", "fontcolor": "black", "label": "" @@ -2387,33 +2387,33 @@ "label": "" }, { - "_gvid": 236, + "_gvid": 234, "tail": 55, - "head": 73, + "head": 31, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 237, + "_gvid": 236, "tail": 55, - "head": 76, + "head": 73, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 238, + "_gvid": 237, "tail": 55, - "head": 77, + "head": 76, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 239, + "_gvid": 242, "tail": 56, - "head": 32, + "head": 78, "color": "black", "fontcolor": "black", "label": "" @@ -2427,17 +2427,17 @@ "label": "" }, { - "_gvid": 241, + "_gvid": 239, "tail": 56, - "head": 74, + "head": 32, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 242, + "_gvid": 241, "tail": 56, - "head": 78, + "head": 74, "color": "black", "fontcolor": "black", "label": "" @@ -2467,33 +2467,33 @@ "label": "" }, { - "_gvid": 246, + "_gvid": 247, "tail": 57, - "head": 78, + "head": 79, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 247, + "_gvid": 246, "tail": 57, - "head": 79, + "head": 78, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 248, + "_gvid": 249, "tail": 58, - "head": 34, + "head": 37, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 249, + "_gvid": 248, "tail": 58, - "head": 37, + "head": 34, "color": "black", "fontcolor": "black", "label": "" @@ -2507,9 +2507,9 @@ "label": "" }, { - "_gvid": 251, + "_gvid": 254, "tail": 59, - "head": 34, + "head": 81, "color": "black", "fontcolor": "black", "label": "" @@ -2523,17 +2523,17 @@ "label": "" }, { - "_gvid": 253, + "_gvid": 251, "tail": 59, - "head": 80, + "head": 34, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 254, + "_gvid": 253, "tail": 59, - "head": 81, + "head": 80, "color": "black", "fontcolor": "black", "label": "" @@ -2555,25 +2555,25 @@ "label": "" }, { - "_gvid": 257, + "_gvid": 258, "tail": 61, - "head": 82, + "head": 83, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 258, + "_gvid": 257, "tail": 61, - "head": 83, + "head": 82, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 259, + "_gvid": 262, "tail": 62, - "head": 54, + "head": 84, "color": "black", "fontcolor": "black", "label": "" @@ -2587,17 +2587,17 @@ "label": "" }, { - "_gvid": 261, + "_gvid": 259, "tail": 62, - "head": 80, + "head": 54, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 262, + "_gvid": 261, "tail": 62, - "head": 84, + "head": 80, "color": "black", "fontcolor": "black", "label": "" @@ -2611,41 +2611,41 @@ "label": "" }, { - "_gvid": 264, + "_gvid": 266, "tail": 63, - "head": 63, + "head": 77, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 265, + "_gvid": 267, "tail": 63, - "head": 66, + "head": 79, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 266, + "_gvid": 268, "tail": 63, - "head": 77, + "head": 81, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 267, + "_gvid": 264, "tail": 63, - "head": 79, + "head": 63, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 268, + "_gvid": 265, "tail": 63, - "head": 81, + "head": 66, "color": "black", "fontcolor": "black", "label": "" @@ -2659,49 +2659,49 @@ "label": "" }, { - "_gvid": 270, + "_gvid": 272, "tail": 64, - "head": 57, + "head": 85, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 271, + "_gvid": 270, "tail": 64, - "head": 82, + "head": 57, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 272, + "_gvid": 273, "tail": 64, - "head": 85, + "head": 86, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 273, + "_gvid": 271, "tail": 64, - "head": 86, + "head": 82, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 274, + "_gvid": 275, "tail": 65, - "head": 57, + "head": 65, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 275, + "_gvid": 278, "tail": 65, - "head": 65, + "head": 87, "color": "black", "fontcolor": "black", "label": "" @@ -2723,9 +2723,9 @@ "label": "" }, { - "_gvid": 278, + "_gvid": 274, "tail": 65, - "head": 87, + "head": 57, "color": "black", "fontcolor": "black", "label": "" @@ -2739,49 +2739,49 @@ "label": "" }, { - "_gvid": 280, + "_gvid": 282, "tail": 66, - "head": 63, + "head": 79, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 281, + "_gvid": 283, "tail": 66, - "head": 66, + "head": 83, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 282, + "_gvid": 281, "tail": 66, - "head": 79, + "head": 66, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 283, + "_gvid": 284, "tail": 66, - "head": 83, + "head": 88, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 284, + "_gvid": 280, "tail": 66, - "head": 88, + "head": 63, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 285, + "_gvid": 287, "tail": 67, - "head": 41, + "head": 58, "color": "black", "fontcolor": "black", "label": "" @@ -2795,9 +2795,9 @@ "label": "" }, { - "_gvid": 287, + "_gvid": 285, "tail": 67, - "head": 58, + "head": 41, "color": "black", "fontcolor": "black", "label": "" @@ -2811,9 +2811,9 @@ "label": "" }, { - "_gvid": 289, + "_gvid": 291, "tail": 68, - "head": 41, + "head": 59, "color": "black", "fontcolor": "black", "label": "" @@ -2827,9 +2827,9 @@ "label": "" }, { - "_gvid": 291, + "_gvid": 289, "tail": 68, - "head": 59, + "head": 41, "color": "black", "fontcolor": "black", "label": "" @@ -2851,9 +2851,9 @@ "label": "" }, { - "_gvid": 294, + "_gvid": 296, "tail": 70, - "head": 44, + "head": 62, "color": "black", "fontcolor": "black", "label": "" @@ -2867,9 +2867,9 @@ "label": "" }, { - "_gvid": 296, + "_gvid": 294, "tail": 70, - "head": 62, + "head": 44, "color": "black", "fontcolor": "black", "label": "" @@ -2891,17 +2891,17 @@ "label": "" }, { - "_gvid": 299, + "_gvid": 300, "tail": 72, - "head": 51, + "head": 54, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 300, + "_gvid": 299, "tail": 72, - "head": 54, + "head": 51, "color": "black", "fontcolor": "black", "label": "" @@ -2915,9 +2915,9 @@ "label": "" }, { - "_gvid": 302, + "_gvid": 305, "tail": 73, - "head": 51, + "head": 91, "color": "black", "fontcolor": "black", "label": "" @@ -2931,17 +2931,17 @@ "label": "" }, { - "_gvid": 304, + "_gvid": 302, "tail": 73, - "head": 90, + "head": 51, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 305, + "_gvid": 304, "tail": 73, - "head": 91, + "head": 90, "color": "black", "fontcolor": "black", "label": "" @@ -2963,25 +2963,25 @@ "label": "" }, { - "_gvid": 308, + "_gvid": 309, "tail": 75, - "head": 92, + "head": 93, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 309, + "_gvid": 308, "tail": 75, - "head": 93, + "head": 92, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 310, + "_gvid": 313, "tail": 76, - "head": 54, + "head": 94, "color": "black", "fontcolor": "black", "label": "" @@ -2995,17 +2995,17 @@ "label": "" }, { - "_gvid": 312, + "_gvid": 310, "tail": 76, - "head": 90, + "head": 54, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 313, + "_gvid": 312, "tail": 76, - "head": 94, + "head": 90, "color": "black", "fontcolor": "black", "label": "" @@ -3051,33 +3051,33 @@ "label": "" }, { - "_gvid": 319, + "_gvid": 322, "tail": 78, - "head": 57, + "head": 95, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 320, + "_gvid": 319, "tail": 78, - "head": 86, + "head": 57, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 321, + "_gvid": 320, "tail": 78, - "head": 92, + "head": 86, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 322, + "_gvid": 321, "tail": 78, - "head": 95, + "head": 92, "color": "black", "fontcolor": "black", "label": "" @@ -3090,14 +3090,6 @@ "fontcolor": "black", "label": "" }, - { - "_gvid": 324, - "tail": 79, - "head": 77, - "color": "black", - "fontcolor": "black", - "label": "" - }, { "_gvid": 325, "tail": 79, @@ -3122,6 +3114,14 @@ "fontcolor": "black", "label": "" }, + { + "_gvid": 324, + "tail": 79, + "head": 77, + "color": "black", + "fontcolor": "black", + "label": "" + }, { "_gvid": 328, "tail": 80, @@ -3187,25 +3187,25 @@ "label": "" }, { - "_gvid": 336, + "_gvid": 337, "tail": 83, - "head": 81, + "head": 83, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 337, + "_gvid": 338, "tail": 83, - "head": 83, + "head": 99, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 338, + "_gvid": 336, "tail": 83, - "head": 99, + "head": 81, "color": "black", "fontcolor": "black", "label": "" @@ -3243,41 +3243,41 @@ "label": "" }, { - "_gvid": 343, + "_gvid": 344, "tail": 85, - "head": 98, + "head": 100, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 344, + "_gvid": 345, "tail": 85, - "head": 100, + "head": 101, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 345, + "_gvid": 343, "tail": 85, - "head": 101, + "head": 98, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 346, + "_gvid": 349, "tail": 86, - "head": 65, + "head": 101, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 347, + "_gvid": 346, "tail": 86, - "head": 78, + "head": 65, "color": "black", "fontcolor": "black", "label": "" @@ -3291,17 +3291,17 @@ "label": "" }, { - "_gvid": 349, + "_gvid": 350, "tail": 86, - "head": 101, + "head": 102, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 350, + "_gvid": 347, "tail": 86, - "head": 102, + "head": 78, "color": "black", "fontcolor": "black", "label": "" @@ -3315,33 +3315,33 @@ "label": "" }, { - "_gvid": 352, + "_gvid": 354, "tail": 87, - "head": 75, + "head": 93, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 353, + "_gvid": 355, "tail": 87, - "head": 87, + "head": 102, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 354, + "_gvid": 353, "tail": 87, - "head": 93, + "head": 87, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 355, + "_gvid": 352, "tail": 87, - "head": 102, + "head": 75, "color": "black", "fontcolor": "black", "label": "" @@ -3355,25 +3355,25 @@ "label": "" }, { - "_gvid": 357, + "_gvid": 358, "tail": 88, - "head": 66, + "head": 79, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 358, + "_gvid": 361, "tail": 88, - "head": 79, + "head": 96, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 359, + "_gvid": 362, "tail": 88, - "head": 84, + "head": 99, "color": "black", "fontcolor": "black", "label": "" @@ -3387,17 +3387,17 @@ "label": "" }, { - "_gvid": 361, + "_gvid": 357, "tail": 88, - "head": 96, + "head": 66, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 362, + "_gvid": 359, "tail": 88, - "head": 99, + "head": 84, "color": "black", "fontcolor": "black", "label": "" @@ -3475,25 +3475,25 @@ "label": "" }, { - "_gvid": 372, + "_gvid": 373, "tail": 93, - "head": 91, + "head": 93, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 373, + "_gvid": 374, "tail": 93, - "head": 93, + "head": 105, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 374, + "_gvid": 372, "tail": 93, - "head": 105, + "head": 91, "color": "black", "fontcolor": "black", "label": "" @@ -3579,25 +3579,25 @@ "label": "" }, { - "_gvid": 385, + "_gvid": 386, "tail": 96, - "head": 94, + "head": 96, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 386, + "_gvid": 387, "tail": 96, - "head": 96, + "head": 105, "color": "black", "fontcolor": "black", "label": "" }, { - "_gvid": 387, + "_gvid": 385, "tail": 96, - "head": 105, + "head": 94, "color": "black", "fontcolor": "black", "label": "" diff --git a/tla_specifications/ewd840/states.png b/tla_specifications/ewd840/states.png new file mode 100644 index 0000000..746221b Binary files /dev/null and b/tla_specifications/ewd840/states.png differ