Skip to topic | Skip to bottom
Minfo.SeLab1r1.3 - 09 Oct 2012 - 23:37 - KrikavaFiliptopic end

Start of topic | Skip to actions

Lab 1 : Set up, building with ant



In this Lab we will go over some of the basics of the Eclipse IDE and the Apache Ant build tool. We will also introduce the running example application that will be used through the course.


  • Installed Java SDK
  • Installed Eclipse
  • Installed Ant

Exercise: Getting started with the creature simulator

The initial code is provided in the archive.

This code contains an application that creates an little framework for simulating creatures. A creature is basically just an object that has some properties (like position, direction, speed, color, ...) and behavior. It can act - change its properties and it knows how to render itself on a graphical canvas. In this lab version, a creature has also a vision. It can see other creatures within certain field of view and a certain distance.

The framework is built on the top of Java Swing library.

Starting with the creature simulator

  1. Create a new Java project in Eclipse
  2. Correctly place the given source files
  3. Make sure you have no errors in the Problems view
  4. Go over the classes to get the notion about how it works

Ant in Eclipse

Ant in Command Line

Exercise: Smart creature

The goal of this exercise is to create a new kind of creature is a bit smarter than the stupid one. It should have following behavior:

  1. It should try to align its speed with the speed of the creatures around.
  2. It should go in the same direction as the creatures around.
  3. It should maintain some minimal distance from the creatures around.

Exercise: Code analysis of the creature simulator

The given code is not well written. Now you will play a role of a senior software developer whose task is to review a code that has been produce by some junior. Try to come up with as many improvements as possible. For example:

  • What to do with some of the utility functions?
  • What to do with the fact that logic of the Environment and the visualization are kept together?
  • ...


Coordinates and Angles


Method distanceFromAPoint()


Method: creaturesAround()


-- KrikavaFilip - 09 Oct 2012
to top

I Attachment sort Action Size Date Who Comment manage 5.6 K 09 Oct 2012 - 23:29 KrikavaFilip Source code for the TP1

You are here: Minfo > SeLab1

to top

Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WIKIDeptinfo? Send feedback