Running Exw.exe ergodicSysMSMN_DrinkMachine.ex.. ------------------------------------- Drink Machine System initial model { {-1,6,7,-1,-1,-1,8,9,10,11,-1,-1,-1}, { {22,13,13}, { { 1, {2,4,13}, {1,1,1} }, { 2, {3,4,7}, { { {0}, 1 }, 1, 1 } }, { 3, {1,3,10}, { { 1, {1} }, 1, 1 } }, { 5, {1,7}, { { 1, {2} }, 1 } }, { 6, {5,12}, { { 1, {3} }, { {4}, 1 } } }, { 7, {6,7}, {1,1} }, { 8, {5,12}, { { 1, {5} }, 1 } }, { 9, {8,9}, {1,1} }, { 10, {3,10}, {1,1} }, { 11, {2}, {1} } }, { { 1, {3,5} }, { 2, {1,11} }, { 3, {2,3,10} }, { 4, {1,2} }, { 5, {6,8} }, { 6, {7} }, { 7, {2,5,7} }, { 8, {9} }, { 9, {9} }, { 10, {3,10} }, { 12, {6,8} }, { 13, {1} } } }, { { {0,0,0,0}, {120,120,100,80}, 0 }, {0,0,0,0}, { { { {99,111,108,97}, 100 }, { {108,101,109,111,110,97,100,101}, 100 }, { {106,117,105,99,101}, 100 }, { {119,97,116,101,114}, 100 } }, {110,111,110,101} }, {120,120,100,80}, {0,0}, {0,0,0}, 0, {}, {}, {110,111,110,101}, 0, {100}, 0 }, {12} } We have inserted a one dollar coin in the coin_slot first iteration # chosen ##### { {0,0,0,0}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,0,0} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,0} # coin adder ##### {0,100'd'} # coin total ##### 0 # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### 0 # coin slot ##### {100'd'} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {6} It is now registered in coin_tally and in the coin adders new_value Now setting coin slot = {0} for no coin # chosen ##### { {0,0,0,0}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,0,0} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,0} # coin adder ##### {0,100'd'} # coin total ##### 0 # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### 0 # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {6,12} second iteration # chosen ##### { {0,0,0,0}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,0,0} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,0} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### 0 # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {6,7} It is now registered in coin_total third iteration # chosen ##### { {0,0,0,0}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### 0 # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {2,5} Now the availability vector has been created, coin_total has been registered by change_calc and the new zero coin_value has been registered by coin_adder fourth iteration # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {1,11} The new availability vector has been registered by chosen and the lights have come on for juice and water. fifth iteration # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {} Now it has reached a steady state and is waiting for more input So now we can choose some water by pressing the fourth button. # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 4 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {13} sixth iteration I now take the finger off the button # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 4 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 100'd' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {1,13} The button press has been registered by chosen seventh iteration # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 99'c' } }, {119'w',97'a',116't',101'e',114'r'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {80'P',100'd'} # coin adder ##### {0,0} # coin total ##### 100'd' # coin reservoir ##### {} # change shute ##### {} # drink shute ##### {110'n',111'o',110'n',101'e'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,100,100,101,100} # Update List ##### {1,3,5} A water has been dispensed by drink_reservoir, the price has been registered by change_calc and the button release has been registered by chosen eighth iteration # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 99'c' } }, {119'w',97'a',116't',101'e',114'r'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {1,0} # coin total ##### 100'd' # coin reservoir ##### { {20} } # change shute ##### {} # drink shute ##### {119'w',97'a',116't',101'e',114'r'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,99,100,101,100} # Update List ##### {5,6,8,10} A reset has been registered by coin_adder, the change has been dispensed by the coin_reservoir and a water is now present in the drink shute ninth iteration # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,1,1} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 99'c' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,100'd'} # coin adder ##### {0,0} # coin total ##### 0 # coin reservoir ##### {} # change shute ##### { {20} } # drink shute ##### {119'w',97'a',116't',101'e',114'r'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,99,100,101,100} # Update List ##### {3,6,7,8,9} The drink_reservoir has finished dispensing the drink, the price has been cleared from change_calc, the coin_total has been reset to zero and the change is now present in the change shute tenth iteration # chosen ##### { {0,0,1,1}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,0,0} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 99'c' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,0} # coin adder ##### {0,0} # coin total ##### 0 # coin reservoir ##### {} # change shute ##### { {20} } # drink shute ##### {119'w',97'a',116't',101'e',114'r'} # lights ##### {0,0,1,1} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,99,100,101,100} # Update List ##### {2,5} The availability vector has gone dormant (no money so none available), the reset coin_total has been registered by change_calc, the reset coin_total has been registered by coin_adder and the coin_reservoir has finished dispensing the change eleventh iteration # chosen ##### { {0,0,0,0}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,0,0} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 99'c' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,0} # coin adder ##### {0,0} # coin total ##### 0 # coin reservoir ##### {} # change shute ##### { {20} } # drink shute ##### {119'w',97'a',116't',101'e',114'r'} # lights ##### {0,0,0,0} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,99,100,101,100} # Update List ##### {1,11} The Null availability vector has been registered by chosen and the lights have turned off twelfth iteration # chosen ##### { {0,0,0,0}, {120'x',120'x',100'd',80'P'}, 0 } # available ##### {0,0,0,0} # drink reservoir ##### { { { {99'c',111'o',108'l',97'a'}, 100'd' }, { {108'l',101'e',109'm',111'o',110'n',97'a',100'd',101'e'}, 100'd' }, { {106'j',117'u',105'i',99'c',101'e'}, 100'd' }, { {119'w',97'a',116't',101'e',114'r'}, 99'c' } }, {110'n',111'o',110'n',101'e'} } # drink prices ##### {120'x',120'x',100'd',80'P'} # change calc ##### {0,0} # coin adder ##### {0,0} # coin total ##### 0 # coin reservoir ##### {} # change shute ##### { {20} } # drink shute ##### {119'w',97'a',116't',101'e',114'r'} # lights ##### {0,0,0,0} # coin slot ##### {0} # buttons ##### 0 # Coin Tally ##### {100,100,99,100,101,100} # Update List ##### {} The Drink Machine is now in a dormant state waiting for input, there is one less water in the inventory, one extra dollar coin and one less 20c coin in the coin_tally, one water in the drink shute and one 20c coin in the change shute. Process terminated successfully. Exit code: 0