FSA Simulator


Assignment 2
Event Driven Computing 2019
Assignment 2 - FSA Simulator
1. Summary
This assignment is the first of two in which you will develop an editing and simulation environment for finite
state automata (FSA).
For this assignment you will develop the basic infrastructure for reading in a representation of a FSA, and
some simulation facilities to be used in the subsequent stages.
Although each assignment is of equal value. The quality of your submission for this part will affect your
marks in the subsequent practical. We urge you to do a good job!
Unlike Assignment 1, you will have at most FOUR (4) submission attempts (details below)
Download the assignment files HERE.
2. Objective
The goal of this assignment is to create a Java class to store deterministic and non-deterministic FSAs, and
allow the behaviour of the FSA to be simulated. In addition, you will write a class that can read/write an FSA
from/to a text file. The external behaviour is prescribed by a number of interfaces that we provide.
3. What we provide
We provide the following files for you:
Fsa.java contains an interface specification for a class that stores a representation of a FSA.
FsaListener.java contains an interface specification for a class that will be notified of changes to the
FSA.
State.java contains an interface specification for a class that stores a representation of a State.
StateListener.java contains an interface specification for a class that will be notified of changes to a
State.
Assignment 2 26/9/19, 8)32 am
https://myuni.adelaide.edu.au/courses/45523/assignments/125877 Page 2 of 4
Transition.java contains an interface specification for a class that stores a representation of a
transition.
TransitionListener.java contains an interface specification for a class that will be notified of changes to
a State.
FsaSim.java is an interface specification that allows a sequence of events to be fed to an FSA and
simulated.
FsaIo.java contains an interface specification for a class that can read or write an FSA from a text-file.
FsaFormatException.java Specifies an exception that is thrown when an error is detected while reading
an FSA specification.
fsa_file_format.pdf a description of the file format used in the text-files read/written by the FsaIo class.
You can download the files HERE.
4. What you must do
You must write two java classes:
FsaImpl.java that implements the Fsa and FsaSim interfaces, and contains a constructor:
public FsaImpl() , and
FsaReaderWriter.java that implements the FsaIo interface, and contains a constructor:
public FsaReaderWriter() .
We suggest the following order for building your implementation:
1. Build the basic code for FsaImpl .
The compiler will insist that you provide all the methods from the Fsa and FsaSim interfaces. You can
keep the compiler happy by arranging that each method's body does something trivial, but correct.
For example, make boolean methods return false , and methods that return an object return null .
When you have completed this, your FsaImpl class should compile without errors.
2. Next, start building the bodies of the FsaImpl methods, one at a time.
Refer to the comments in each of the interface files for information on what each method should do.
3. If you need additional classes (for example, to implement a state), you can use the same dummy-body
technique that was used with Fsa to allow the class to compile, even though its methods are not yet
complete.
4. Test the methods as you build them, and only move on when you know the code is correct. You will end
up making your tester program bigger and bigger, as development proceeds.
You can test your code by creating a Java class with a main() method that creates instances of your
other classes and tests all of the methods of each.
5. To simplify things, do not bother to implement the addListener and deleteListener methods in any of
the classes until we cover the concept of listeners; they can be done later. The amount of code required
is quite small and is easy to debug.
Assignment 2 26/9/19, 8)32 am
https://myuni.adelaide.edu.au/courses/45523/assignments/125877 Page 3 of 4
6. Keep working on FsaImpl until it is complete.
7. Now, write the code for FsaReaderWriter. You will find that the write method is much simpler than read,
so do it first. Once you know it works, you can use it to help you to debug the code for reading a FSA.
You can find details on the file format in fsa_file_format.pdf
8. You now have most of the code working. And, if your testing has been thorough, it should be correct.
9. Finally, add code for the addListener and deleteListener methods in the classes. Arrange to call the
listeners whenever a change occurs in the class. For example, when a new place is added to the map,
you must call the placesChanged() method of any of the registered listeners. You’ll need to extend your
tester to verify that this code works properly.
5. Assessment
We will test the behaviour of your classes using the Web Submission system. There are two entries in the
Web Submission system for this assignment:
Assignment 2 Acceptance Tester
Submitting to this entry performs only trivial tests to verify that nothing is catastrophically wrong with your
program.
Use it as a sanity check before submitting your work to the FINAL SUBMISSION. Your program should pass
all the Acceptance tests, or you will likely fail a very large number of the final tests.
You may submit to the Acceptance Tester as many times as you like, however these do not count for
marks.
Assignment 2 FINAL SUBMISSION
This entry consists of a large suite of tests (nearly 100) that will aggressively verify that your program works
correctly. Since this is an honours/advanced elective, we do not provide access to the full set of our tests
and the feedback given is limited. We therefore encourage you to thoroughly test your code yourself prior to
submitting to this entry.
You can only submit to the FINAL testing script FOUR (4) times
6. Submitting your work
Your work will be submitted to the Web Submission System via SVN.
Adding your files to SVN
1. If you are unfamiliar with SVN, review this guide:
http://www.cs.adelaide.edu.au/docs/svn-instr.pdf (http://www.cs.adelaide.edu.au/docs/svn-instr.pdf)
2. Create a repository for this assignment, and check out a working directory, ready for work (replacing
aXXXXXXX with your username):
Assignment 2 26/9/19, 8)32 am
https://myuni.adelaide.edu.au/courses/45523/assignments/125877 Page 4 of 4
svn mkdir --parents -m "Setup assignment 2" https://version-control.adelaide.edu.au/svn/aXXXXXXX/2019/s
2/edc/assignment2
svn checkout https://version-control.adelaide.edu.au/svn/aXXXXXXX/2019/s2/edc/assignment2
3. Create your FsaImpl.java and FsaReaderWriter.java files in the folder you checked out.
4. Add and commit your files:
cd assignment2
svn add FsaImpl.java
svn add FsaReaderWriter.java
svn commit -m "assignment2 solution"
Submitting on Web Submission
5. Next, go to the web submission system at:
https://cs.adelaide.edu.au/services/websubmission/index.php
(https://cs.adelaide.edu.au/services/websubmission/index.php?
sub_year=2019&sub_period=s2&sub_course=edc&sub_assign=assignment2-accept)
and select 2019 -> Semester 2 -> Event Driven Computing -> Assignment 2 Acceptance Tester

FSA Simulator代做
6. Click Make Submission , then Search Log Up To Revision and select the revision of work you'd like to
submit. Click Submit/Re-Submit Selected Revision then complete the declaration.
7. Click View Feedback to review your feedback.
You may resubmit to the Acceptance Tester as many times as you like
Submitting for marks
8. Once you have thoroughly tested your code AND it is passing the Acceptance Tester AND you are
ready for marking, go to the web submission system at:
https://cs.adelaide.edu.au/services/websubmission/index.php
(https://cs.adelaide.edu.au/services/websubmission/index.php?
sub_year=2019&sub_period=s2&sub_course=edc&sub_assign=assignment2-final)
and select 2019 -> Semester 2 -> Event Driven Computing -> Assignment 2 FINAL SUBMISSION
9. Submit your work as before.
You can only submit to the FINAL testing script FOUR (4) times
Your final mark will be your highest mark in the FINAL SUBMISSION

 

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codehelp

上一篇:c#-根据系统状态以不同方式处理控制事件


下一篇:C#程序化鼠标移动/点击