Professional Documents
Culture Documents
VendingMachine usingTOC
VendingMachine usingTOC
VendingMachine usingTOC
Automata Design with Time Complexity for Intelligent Vending Machine based on
Visual Automata Simulator
Abstract—Automata theory and design are core areas of most mobile features. Perhaps, we can extend these machines into
of the software developments which improves the efficiency of different services as well.
the vending machines used in all sectors including academic Some problems are computationally hard and others are
environments. We have studied and identified many problems easy because the computational complexity is dominating in
of vending machines which are convertible to intelligent
all designs, developments and implementations. In all these
approach without increasing complexity. In this research,
improving efficiency and complexity reduction are considered cases, the theories of computability and complexity are
using appropriate automata design. In order to solve these closely related. Handling of complexity in all automata
problems, we have employed efficient automata design and design problems requires a precise definition of appropriate
visual automata simulator which allows us to increases the computations used in the applications which include vending
efficiency of the vending machine. To verify our results, we machine. Reducibility and decidability in automata designs
tested our design with different word lengths. As early results, play the important role in reducing complexity [6-7].
we have simulated the final design with selected feature which Intelligent vending machines (IVM) provide a number of
adds intelligence to the existing automata design of vending facilities with advanced features. They are anti-theft, facial
machine. In the overall conclusion, we prove that intelligent
recognition etc. but they are controlled by the touch screen
feature can be added without increasing the complexity.
which increases the efficiency of steps used in IVM.
Keywords-automata theory; finite state machines; vending Applications of Deterministic Finite Automata (DFA) are
machine; complexity; visual automata simulator; communication protocol and microcontroller designs used
in electro-mechanical devices [8]. Intelligent approach to
I. INTRODUCTION design used in modern vending machines depends on the
efficient protocols and microcontrollers.
Alan Turing is the great scientist and he solved many The rest of the paper is organized as follows. Section II
problems in automata design. Cash dispensers, vending explains the quick literature review of basic and modern
machines and other self-servicing machines depend on the vending machines which use conventional and intelligent
automata design. Computational development and automata features. In section III, we provide necessary points about
simulator tools also play a significant role in the efficient the theory of automata design which is relevant to this
designs. These days, computer video games are also research. Section IV provides the steps of the algorithm
expecting significant changes which are not only in the which we employ in this research. Implementation and
design and development but also in the improvement of necessary results obtained from VASs are organized in
intelligent. These automata designs are implemented using section V. In section VI, overall conclusions are written
different simulators but we have considered visual automata based on the theoretical analysis and results.
simulator (VAS) which is a new tool for this design. Also,
it's compatibility allows us to integrate with other tools. II. LITERATURE REVIEW
Vending Machines are used to dispense various items Many researches have been investigated the architecture
which are cash withdrawal, purchasing tickets, collecting of the vending machines. A few of them are discussed here
quick foods etc [1-3]. The first commercial coin-operated as: Fauziah Zainuddin [9] proposes a vending machine for
machine was introduced in London and England used for serving food in appropriate way. Here, researcher used three
selling post cards. The vending machines are available to different features in his design they are user selection state,
which people are in working environments and other areas freezer state and steaming state.
such as public and private places. In future, vending In complexity theory, we classify computational
machines become mobile and intelligent approach because problems of vending machine design and increasing features
they are more accessible and practical than the ordinary coin according to their time complexity. In some designs, the
operating machines [4-5]. Further, these machines are very same language takes different time requirements during the
important for the medical services which need intelligent and processing. Here, design of the vending machines may be a
160
IV. ALGORITHM DESCRIPTION AND PROPOSED DESIGN machine’s finite state diagram will visualize and simulated
After the design and analysis, we have developed using VAS. In this proposed design, VAS and its operations
following algorithms which could be applicable not only in take important roles in our time-complexity analysis.
the specific vending machine but also other developments Although vending machines already exist, analysis of time
such as games provided through mobile and wireless service complexity will improve the functionalities of future IVM.
providers. C. Methodology
A. Algorithm In this paper, we prefer to use VAS tool to describe the
The cashless is one of the example features used for design methodology of proposed vending machines which
making IVM. Necessary steps are given below. include IVM. Using our algorithm, the time complexity is
analyzed for different word lengths used in our approaches.
Input: user selection and desired currency ={K1, K2…} Although VAS is a helpful tool for simulating FSA, we have
used this tool for experiments which are comparisons of
Output: proposed vending machine which accepts (a) or
basic and intelligent features. In these two approaches,
rejects (r) string. average time complexity is calculated using selected
Initialize: initial state, count =0. features, counted word-lengths, steps, processing and other
1. User, select one book from the four available books parameters used in the automata theory.
2. If the user enters e then
3. Go to “select 1“state. (Language)
4. Else If user enters a then V. IMPLEMENTATION AND RESULTS
5. Go to “select 2“state. (Main category or field) The proposed vending machine is simulated using the
6. Else If user enters n then latest version of VAS tool which allows us to handle the
7. Go to “select 3“state. (Topic) intelligent feature. Each word used in the transition of FSM
8. Else If user enters a then represents the behavior of the conventional and proposed
9. Go to “select 4“state. (Specific) design with corresponding states and transitions. As soon as
10. Else the machine reaches accepting state, the IVM delivers the
11. Reject the message. book. In order to understand the processing, basic coin
12. End if operation is used in each transition of conventional vending
13. Repeat{ machine. In these operations, we can add this intelligent
14. If the user enters first total: feature "cashless payment" without changing main
15. Count=count + first total {c} architecture. In this design, states which have two circles, are
16. Go to “count” state and word length. accepting state.
17. Else user enters second total: A. Implementation of accepting operation
18. Count=count + second total {c}
The user select Arabic book and enter 10,10,10,10 and
19. Go to “count” state and word length.
ten respectively and table 1 shows this transition table for
20. End If
serving book using the book vending. Thus, the string is
21. } until (no money in the bank);
a11111b. The Final b inserted refer to the end of the
22. If count = book price then
operation; it is only used for explains the debug steps until
23. Accept (a) message with total word length.
accept state. Table I shows the transition states for accept
24. Else
operation; the user will implement the flowing transition in
25. Reject (r) the message with total word length.
order to receive the book he wants. In this processing, we
26. End If
observed time complexity with other existing software tools.
27. End
To analyze the time complexity, automata technique and
.
each operation used in the design studied with different
strings.
B. Description of vending machine
TABLE I. TRANSITION DETAILS FOR SERVING BOOK
Here, basic operation of vending machine is described with
necessary features. It is a multi-select books machine with Selected string a11111b
FSM based. It is improved to deliver books depending on the symbol Remaining string States
user selection for a specific type of available books, and then a 11111b [Select 2], accepting = false
touch the screen which shows the amount of money in Saudi 1 1111b [10SR], accepting = false
Riyal (SR) or other foreign currency. Cancel feature; that 111b
1 [20SR], accepting = false
means the customer can discard the ordering of product and
1 11b [30SR], accepting = false
end the buying operation. The user does not need to insert
the money which is equal to the price of the book he/she 1 1b [40SR], accepting = false
wants. This intelligent approach allows us to increase some 1 b [50SR], accepting = True
more intelligent features without increasing complexity. Our
161
For instance, four books and two Saudi Riyals (10 and As shown in figure 1, basic coin operation of vending
20) are considered to show this processing which needs machine can be built. In the conventional vending machine,
twenty states. Assume that the price of the Arabic book and basic features mentioned in [10] are used. The user can still
English book is the same. Thus; the transition from Select 2 select different operations which allow him/her to choose
goes to the same transition of select 1. So the state diagram either intelligent or conventional feature. Each case, word
only shows the 16 states excluding the five states of select 2. length should be considered carefully. Otherwise overall
The Initial State, when the machine is ready to perform time complexity will be increased.
the sale operation. Assume that the machine uses fixed In figure 1, the transition from the initial state (v0) to
length of the word for which selected abbreviation is used other states (v1, v2 and v3), which represents some behavior
during the sales. After the selection of book type, the user of Mealy vending machine. In this, there is no accepting or
has to insert the money which is the amount of the specific rejecting state, but one of the states should be assumed as an
book. In this case an Arabic book requires 50 SR. At the output state. In this example, q0, n and d are inputs, and c0,
first time, the user may insert 10SR and continue or user can c1, c2 and c3 are outputs. Letter "e" represents empty
use a single payment. transition.
162
Again time complexity is analyzed as in automat theory of using coins, we can use credit cards or mobile phones
and VAS. These existing designs encourage us to add the which link with the banks. In this paper, the specific
intelligent feature which not only provides the intelligent processing of IVM is not considered because we assume
action but also reduce the cost. The user still inserting that steps for the intelligent feature “cashless” are equal to
another 10 SR. and the reminder of the note price 30 will coin operation. Although steps are same in each case, word
equal to 10 SR. Figure 2 can be used to show the transition length which we use in these operations may be different.
of second 10 SR. Then the user decides to cancel the Each operation may have different processing which
operation; because of that the operation was rejected. The depends on the features. Overall, types of feature,
cancel operation accepted only when the user decides to operations, steps and processing are very important to
cancel the operation before inserting money. analyze the complexity. We assume that the bank pays the
final total through cashless payment method when state
C. Cashless operation of intelligent behavior
diagram reaches the accepting state.
As shown in figure 2, we have designed the IVM with
same number of states and transitions. In this design, instead
163
Time complexity of conventional vending machine Time complexity of intelligent vending machine
80 70
Existing Existing
Proposed Proposed
70 60
60 50
Complexity T(n)
Complexity T(n)
50 40
40 30
30 20
20 10
10 0
100 200 300 400 500 600 700 800 900 100 200 300 400 500 600 700 800 900
Lengths of words (n) Lengths of words (n)
Figure 3. Time complexity comparisons for conventional (left figure) and intelligent vending machine (right figure)
VI. CONCLUSIONS [6] Hopcroft, John E. and Jeffrey D. Ullman, "Introduction to Automata
Theory, Languages, and Computation", Reading, MA, Addison-
The design of vending machine based on automata theory Wesley, 1979.
is studied. We have identified few intelligent features which [7] Michael Sipser, "Introduction to the Theory of Computation",
are very useful and profitable because it not only minimizes Second Edition Massachusetts Institute of Technology, ISBN 0-534-
the cost and complexity but also it increases the processing 95097-3, 2006, USA
speed, safety and security. We studied the VAS and its [8] Qureshi, M., Aziz, A., Rasool, H., Ibrahim, M., Ghani, U. and Abbas,
features which monitor the time complexity dynamically. H, "Design and Implementation of Vending Machine using Verilog
HDL". 17, 2011.
Through these designs and implementations, we identified
[9] Fauziah Zainuddin, Norlin Mohd Ali, Roslina Mohd Sidek, Awanis
that VAS could be a reliable tool to improve the efficiency Romli, Nooryati Talib & Mohd. Izham Ibrahim, “Conceptual
and accuracy of intelligent features expected to integrate Modeling for Simulation: Steaming frozen Food Processing in
with future vending machines. In future work, we will have Vending Machine” International Conference on Computer Science
to analyze the time complexity of other features which are and Information Technology,University Malaysia Pahang, pp.145-
applicable to future IVM. 149, 2009.
[10] Varkey, M. and Sunny, J. "Design and Implementation of Multi
REFERENCES Select Smart Vending Machine". International Journal of Computer
Networks and Wireless Communications (IJCNWC), ISSN: 2250-
[1] Zhang Wen & Zhang Xin Long, “Design and Implementation of 3501, 2014.
automatic vending machine Based on the short massage payment”
[11] Ana Monga, Balwinder Singh. "Finite State Machine based Vending
International Conference on Information and Communications
Machine Controller with Auto-Billing Features. International Journal
technology in Electrical Sciences, Neijiang, Sichuan, China.pp.978-
of VLSI design & Communication Systems (VLSICS) Vol.3, No.2,
981, 2010.
2012.
[2] B. Caulfield & M.O Mahony, “Passenger Requirements of a Public
[12] Frost & Sullivan*, “Assessment of the Intelligent Vending Machines
Transport Ticketing System” Proceedings of the 8th International
Market, November 2011.
IEEE Conference on Intelligent Transportation Systems Vienna,
Austria, pp-32-37, 2005. [13] Jean Bovet, “visual automata simulator tool”, laboratory manual,
USA.
[3] Biplab Roy & Biswarup Mukherjee “Design of Coffee Vending
Machine using Single Electron Devices” Proceedings of 2010 [14] Cynthia Dwork and Larry J. Stockmeyer. A time complexity gap for
International Symposium on Electronic System Design. Pp. 38-43, twoway probabilistic fnite-state automata. SIAM Journal on
2010. Computing, 19(6):1011-1123, 1990.
[4] M.Bhuvaneswari, S.Sukhumar, N.Divya, S.Kalpanadevi, [15] Dash, T. and Nayak, T. "Quantum Finite Automata: a Language
N.SuthanthiraVanitha, "Embedded System Based Automatic Ticket Acceptor Model", International Journal of Advanced Research in
Vending Machine for Modern Transport System", International Computer Science and Software Engineering, Volume 2, Issue 9,
Journal of Advanced Research in Computer and Communication September 2012.
Engineering Vol. 2, Issue 11, 2013. [16] John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman, “Introduction
[5] Sakshi Sharma, Ana Monga, "Implementation of Reverse Vending to Automata Theory Languages and Computation”. Ch-1, 27-29, 3rd
Machine Based on FPGA", International Journal of Emerging Edition Cornell University, Stanford University, California, 2001,
Technologies in Computational and Applied Sciences (IJETCAS), USA.
2011.
164