<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Project | Kun WANG</title><link>https://kunwang.info/categories/project/</link><atom:link href="https://kunwang.info/categories/project/index.xml" rel="self" type="application/rss+xml"/><description>Project</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Wed, 03 Jan 2024 00:00:00 +0000</lastBuildDate><image><url>https://kunwang.info/media/icon_hu_23dc6ba021a93541.png</url><title>Project</title><link>https://kunwang.info/categories/project/</link></image><item><title>Cross-Platform Comparison of Arbitrary Quantum Processes</title><link>https://kunwang.info/publication/2024-zheng-cross/</link><pubDate>Wed, 03 Jan 2024 00:00:00 +0000</pubDate><guid>https://kunwang.info/publication/2024-zheng-cross/</guid><description/></item><item><title>Turing Machine Simulator</title><link>https://kunwang.info/posts/2020-05-06-turing-machine-simulator/</link><pubDate>Wed, 06 May 2020 00:00:00 +0000</pubDate><guid>https://kunwang.info/posts/2020-05-06-turing-machine-simulator/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I developed a Turing machine simulator when I was a teaching assistant for the course &amp;ldquo;Introduction to Models of Computation&amp;rdquo;.
You can find the project in
.
It is based on a nice Java Turing machine simulator from
with necessary
updates. Feel free to fork, modify it.&lt;/p&gt;
&lt;p&gt;The syntax of Turing machine is totally from the book of
&amp;ldquo;&lt;em&gt;Introduction to Models of Computation&lt;/em&gt;&amp;rdquo; by professor Fangmin Song, which you can buy from
.&lt;/p&gt;
&lt;h2 id="description"&gt;Description&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;bin&lt;/code&gt;: Contains the compiled .class files. The &amp;ldquo;images&amp;rdquo; sub-directory is very important as it stores the required images for the simulator. In the next update, I will try to move it out of the &amp;ldquo;bin&amp;rdquo; directory.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;files&lt;/code&gt;: Contains the program description for specific operations. Examples include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Adder.tur&lt;/strong&gt;: a program for adding two non-negative integers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;copyString.tur&lt;/strong&gt;: a program for copy a string of &lt;em&gt;11&amp;hellip;11&lt;/em&gt;s.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In these two files, I gave a detail description of the requirements for writing a program that can be accepted by the simulator.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;src&lt;/code&gt;: Source files of the simulator.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;All of the above three directories are required for running the simulator.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;introduction.pptx&lt;/code&gt;: Actually, the Turing machine simulator is a project for the third assignment of the course &lt;strong&gt;Software Architecture&lt;/strong&gt;. &lt;code&gt;introduction.pptx&lt;/code&gt; is my presentation on the course, which introduces basic ideas of the project, and the design patterns that have been applied.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TMSimulator.7z&lt;/code&gt;: The packed runnable jar, with necessary config files.&lt;/p&gt;
&lt;h2 id="how-to-use"&gt;How to Use&lt;/h2&gt;
&lt;p&gt;There are two different ways to setup the simulator.&lt;/p&gt;
&lt;h3 id="method-1-running-the-jar-file"&gt;Method 1: Running the jar file&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Download the repository.&lt;/li&gt;
&lt;li&gt;Unpack &lt;code&gt;TMSimulator.7z&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;code&gt;run.bat&lt;/code&gt; batch file.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Warnning!&lt;/strong&gt; The &lt;code&gt;files&lt;/code&gt; and &lt;code&gt;TMSimulator.jar&lt;/code&gt; must be in the same directory with &lt;code&gt;run.bat&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="method-2-importing-the-project-into-eclipse"&gt;Method 2: Importing the project into eclipse&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Download the repository.&lt;/li&gt;
&lt;li&gt;Import into eclipse.&lt;/li&gt;
&lt;li&gt;Run it!&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="known-problems"&gt;Known problems&lt;/h2&gt;
&lt;h3 id="problem-1"&gt;Problem 1&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Problem Description:&lt;/strong&gt; When exporting the project as a runnable jar (TMSimulator.jar is exported in this way), images cannot be load, as the jar cannot find the images.&lt;br&gt;
&lt;strong&gt;Current Solution:&lt;/strong&gt; This problem happens because the exporting system hasn&amp;rsquo;t add the necessary files in &lt;code&gt;bin/images&lt;/code&gt; into the jar file. There are two solutions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Modify the code to add the files.&lt;/li&gt;
&lt;li&gt;Add the &lt;code&gt;images&lt;/code&gt; directory into the jar file manually.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Due to my laziness, I take the latter one. It deserves better solution.&lt;/p&gt;
&lt;h3 id="problem-2"&gt;Problem 2&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Problem Description:&lt;/strong&gt; The input and output have been restricted into binary values, which are required by the simulator yet are not that human friendly.&lt;br&gt;
&lt;strong&gt;Possible Solution:&lt;/strong&gt; One encode module to translate the input decimal integers into corresponding bianry values, then feeding them into the simulator. One decode module to translate the output bianry value into corresponding decimal integer, then displaying out.&lt;/p&gt;
&lt;h2 id="more-on-the-simulator"&gt;More on the Simulator&lt;/h2&gt;
&lt;p&gt;If you have any ideas on the project, please feel free to let me know. You can try following ways to keep us in touch.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Comment on this post. This is highly recommended.&lt;/li&gt;
&lt;li&gt;Fork the project, and push the new version to me.&lt;/li&gt;
&lt;li&gt;Email me.&lt;/li&gt;
&lt;/ol&gt;</description></item></channel></rss>