Homework Assignment 1: Q & A

  1. Question: I'm trying to compile on Linux (Ubuntu) and I get the following errors:

    /usr/lib/jvm/java-6-sun/bin/javac -g -d ./classes -deprecation -sourcepath ./src -classpath \:./classes\:./../lib/farmants.jar\:./../lib/farmbandit.jar\:./../lib/farmgeneric.jar\:./../lib/farmsat.jar\:./../lib/farmsimulator.jar\:./../lib/utilities.zip\ src/farm/graphcolor/plugins/GraphClusterAnalysis.java

    src/farm/graphcolor/plugins/GraphClusterAnalysis.java:60: cannot find symbol
    symbol: class GraphColorAnalysisFunction
    class GraphClusterAnalysisFunction extends GraphColorAnalysisFunction {

    src/farm/graphcolor/plugins/GraphClusterAnalysis.java:35: incompatible types
    found : farm.graphcolor.plugins.GraphClusterAnalysisFunction
    required: farm.simulator.LocalFunction
    LocalFunction function = new GraphClusterAnalysisFunction();

    src/farm/graphcolor/plugins/GraphClusterAnalysis.java:64: cannot find symbol
    symbol : variable super
    location: class farm.graphcolor.plugins.GraphClusterAnalysisFunction
    super.run(simulator);

    src/farm/graphcolor/plugins/GraphClusterAnalysis.java:70: cannot find symbol
    symbol : variable nodes
    location: class farm.graphcolor.plugins.GraphClusterAnalysisFunction
    for(Iterator i = nodes.iterator();i.hasNext();){

    4 errors

    which seem to be related to the graphcolor plugin... I think I have everything set up correctly for compilation, because the other classes seem to compile fine (besides some errors with javadoc, but it doesn't matter).

    Answer: You can ignore these erros. They relate to the graphing tool that comes with the farm simulation. We do not use it for this project.

  2. Question: When I do runradar, I get either no windows, or fewer windows than I should

    Answer: The old radar.tar.gz file had some files that shouldn't be there (their names start with ._). I removed these files and overwrote the old radars with a new one here.

    Now after unzipping this tar and running 'make' under radar, you may get a message that nothing needs to be done. What's happening is that 'make' doesn't realize that it needs to re-create the class files. A quick solution is to 'touch' all source files using

    touch src/farm/radar/agent/*

    touch src/farm/radar/agent/utilities/*

    touch src/farm/radar/plugins/*

    Now when you run 'make', you'll see it's making something!

    Alternative A qicker way of doing this is to do the following (thanks to Jeff Dalton for pointing this out)

    cd farm

    make clean

    make

    cd radar

    make clean

    make

  3. Question: I am using putty to ssh to the edlab machines from Windows. But the default putty ssh settings don't contain the -XY options that we need in order to see graphics. What can I do?

    Answer: You can try the solution in this link (thanks to Tian Guo).

  4. Question: The description of the assignment talks about the formal representation of the problem. Do we have some static hard-coded values of the set R,Vi and T, or that is supplied at the run time? If it's the static data, where can I find it?

    Answer: Thats supplied to you at runtime. Its dynamic and randomly set by the simulator every run. The RadarMetAgent.java class has variables that regulates the number of the radars and tasks that will be provided to you at every run however.