Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added missing instructions (doh)

  • Loading branch information...
commit a421a8b84c1d28f97fbeeb0b8aca57be2eb9a449 1 parent 4fcbb32
Richard Vaughan authored

Showing 1 changed file with 93 additions and 0 deletions. Show diff stats Hide diff stats

  1. +93 0 HW1_data_structures.txt
93 HW1_data_structures.txt
... ... @@ -0,0 +1,93 @@
  1 +* CMPT 431 Distributed Systems - Richard Vaughan *
  2 +
  3 +Homework 1: Speed up Universe by data structure improvements
  4 +============================================================
  5 +
  6 +Your task is to speed up Universe by breaking up its single O(n^2)
  7 +distance comparison computation into multiple sequential O(m^2)
  8 +computations, where m < n. The goal is for the sum of the run time of
  9 +all the sequential computations to be less than that of the original.
  10 +
  11 +The problem of measuring the distance between all n robots must be
  12 +partioned somehow. We discussed in class some ideas about partitioning
  13 +space into contiguous sections. Other approaches exist, such as
  14 +hierarchical space decomposition such as quad trees and pyramids
  15 +(explained in any computer graphics text). Various clustering methods
  16 +may also be used to maintain groups of neighboring robots without a
  17 +fixed spatial partition.
  18 +
  19 +You are free to choose any method that interests you, however you have
  20 +limited time so choose something that you can implement quickly.
  21 +
  22 +The main distance calculation for one robot to fill its array of
  23 +sensors is the Univers::Robot::UpdatePixels() method.
  24 +
  25 +Testing
  26 +-------
  27 +
  28 +Universe understands these command line switches:
  29 +
  30 +-? : Prints this helpful message.
  31 +-c <int> : sets the number of pixels in the robots' sensor
  32 +-d : Disables drawing the sensor field of view. Speeds things up a bit.
  33 +-f <float> : sets the sensor field of view angle in degrees
  34 +-p <int> : set the size of the robot population
  35 +-r <float> : sets the sensor field of view range
  36 +-s <float> : sets the side length of the (square) world
  37 +-u <int> : sets the number of updates to run before quitting
  38 +-w <int> : sets the initial size of the window, in pixels
  39 +-z <int> : sets the number of milliseconds to sleep between updates
  40 +
  41 +Test your code by timing the real time it takes to do 10,000 update
  42 +steps, with a between-step sleep time of zero, for sensor view angles
  43 +of 270 degrees (the default) and 10 degrees, for increasing population
  44 +sizes [10, 100, 500, 1000, ... up to as large as you like] Like
  45 +this:
  46 +
  47 +$ time ./universe -d -z 0 -f 10 -u 10000 -p 500
  48 +real 1m18.766s
  49 +user 1m15.687s
  50 +sys 0m0.992s
  51 +
  52 +Run this a few times to obtain an average run time: this is your speed
  53 +metric.
  54 +
  55 +(We need to run for many simulation steps since the robot behaviour is
  56 +very different at t=0 and t=<thousands> when the sensor FOV is small,
  57 +and your run speed may be effected by the robot behaviour).
  58 +
  59 +Reporting
  60 +---------
  61 +
  62 +0) Sign up for a 10-minute demo meeting with the instructor or TA,
  63 + using the sign-up sheet linked from the class webpage.
  64 +
  65 +1) Write a 2 page report
  66 +
  67 + a) explaining the approach and outlining the changes you made to
  68 + the code.
  69 +
  70 + b) explaining the new runtime complexity of your Universe.
  71 +
  72 + b) stating your performance claims, supported by timing data. Don't
  73 + forget to report variance along with mean run times. Is your
  74 + modified universe faster than the original? Is this true for all
  75 + population sizes? Why, or why not?
  76 +
  77 +2) Meet the instructor in CSIL to explain and demonstrate your code.
  78 +
  79 + Before your meeting time, you should set up your code runnning on a
  80 + CSIL workstation or your laptop. Bring a paper copy of your draft
  81 + report to discuss. You can revise your code and report after the
  82 + demo meeting and before submission.
  83 +
  84 +3) Submit the final version of your report electronically using the
  85 + CMPT submission server.
  86 +
  87 +
  88 +Getting Help
  89 +------------
  90 +
  91 +Follow the procedures on the class web page for getting help with this
  92 +assignment. Do not share code with your colleages, but discussing and
  93 +comparing stategies is encouraged.

0 comments on commit a421a8b

Please sign in to comment.
Something went wrong with that request. Please try again.