To be able to run any course related tools and packages (for example TSim) you need to first run the following command:
$ setup_course tda381
Note that the old course code TDA381 is used here.
You are strongly encouraged to test your lab solutions on a multi-processor or
multi-core machine, for example
remote[n].student.chalmers.se. Since these
machines do not have a lot of memory, you need to compile your labs with the
-J-Xmx20m to tell the Java Virtual Machine to use only 20MB of
memory---see example below.
javac -J-Xmx20m Lab1.java
Although it is a little complicated, it is possible to run the tools needed for the Java-related exercises and assignments used in the course. It relies on having Cygwin installed. Cygwin is a set of tools which makes your Windows machine more unix like.
At some point, Cygwin will show you a big meny of additional things to install. You need to install the following things:
To download Erlang/OTP, simply go to this webpage and choose the version to install depending on your machine operating system.
Some GNU/Linux distributions have packages for Erlang which have removed the support for the graphical interface that you will need for the labs (e.g., Ubuntu). Therefore, we recommend you to use the link given above and fetch the package for your distro there.
You will need to install the 32-bit version of Erlang/OTP in order for the CCHAT lab to work.
In this section we are going to describe how to run the course tools from a server on Chalmers but having the windows displayed on your local Windows computer.
Click on the Windows start menu and choose Cygwin-X and then XWin Server. A window with a shell will open.
In the new window type
ssh -Y USERNAME@remoteN.studat.chalmers.se.
USERNAME is your username on Chalmers computers
N is a number from 1 to 5. You might get questions about
RSA fingerprints and you can just answer yes to that question. Then you will
be prompted about your password.
You are now logged into Chalmers with the additional benefit that you can have windows show up on your screen. You probably want to start and editor first. You can do that as follows:
A window should appear on your screen running Emacs. Running the train simulator is as simple as writing:
tsim bana &
Go to the downloads section of lab1 and download the example, the map, the TSim interface, the simulator source code and the source code.
Install development libraries for the simulator's dependencies: Xaw, Xt, Xmu, X11 and Xext.
sudo apt-get install libxaw7-dev libxt-dev libxmu-dev libx11-dev libxext-dev
sudo yum install libXaw-devel libXt-devel libXmu-devel libX11-devel libXext-devel
sudo pacman -S libxaw libxt libxmu libx11 libxext
Unpack the tsim source code:
tar -xzf tsim-0.84.tar.gz
Build and install tsim:
cd tsim-0.84 && ./configure && make && sudo make install && cd ..
Build the 2 program (requires a C compiler, obviously):
gcc -o 2 2.c
Unpack the TSim interface:
tar -xzf Tsim.tar.gz
Build the example:
./2 "tsim --speed 20 Lab1.map" "java Lab1 10 5 20"