Revision 78:47089731ccad

View differences:

src/main/java/cz/agents/alite/tactical/universe/world/map/StreetGraph.java
216 216
        addVertex(dummyNode);
217 217

  
218 218
        normalizeEdgeLength(NORMALIZED_EDGE_LENGTH);
219

  
220
        System.out.println("Loaded: " + nodes.size() + " nodes");
221
        System.out.println("Loaded: " + edgeSet().size() + " edges");
222
        if( streetGraphIsEmpty ) {
219
        if( !streetGraphIsEmpty ) {
220
	        LOGGER.info(">>> Loaded: " + nodes.size() + " nodes");
221
	        LOGGER.info(">>> Loaded: " + edgeSet().size() + " edges");
222
        }
223
        else {
223 224
    		LOGGER.info(">>> StreetGraph is empty.");
224 225
        }
225 226
    }
src/main/java/cz/agents/alite/tactical/universe/world/map/UrbanMap.java
6 6
import java.util.List;
7 7
import java.util.Random;
8 8

  
9
import org.apache.log4j.Logger;
10

  
9 11
import cz.agents.alite.tactical.universe.TacticalUniverse;
10 12
import cz.agents.alite.tactical.util.OrientedPoint;
11 13
import cz.agents.alite.tactical.util.Point;
......
22 24
    private Visibility visibility;
23 25
    private AirplaneManeuverGraph airplaneManeuverGraph;
24 26
    private ObjFileProcessing objFileProcessing;
27
    
28
    private static final Logger LOGGER = Logger.getLogger(UrbanMap.class);
25 29

  
26 30
    public UrbanMap(TacticalUniverse universe) {
27 31
        streetGraph = new StreetGraph(universe);
......
115 119
            	buildings.add(new Building(points, minAlt, maxAlt-minAlt));
116 120
            
117 121
        }
118
        System.out.println("Loaded: " + buildings.size() + " buildings");
119
        System.out.println("Generated crossroad markers");
122
        LOGGER.info(">>> Loaded: " + buildings.size() + " buildings");
123
        LOGGER.info(">>> Generated crossroad markers");
120 124
    }
121 125

  
122 126
    public OrientedPoint getNearVisibleRandomPoint(Random random, OrientedPoint from, double radius) {
src/main/java/cz/agents/alite/tactical/util/objReader/Build.java
4 4
import java.util.ArrayList;
5 5
import java.util.HashMap;
6 6

  
7
import org.apache.log4j.Logger;
8

  
7 9
public class Build implements BuilderInterface {
8 10

  
9 11
	private static final String BUILDINGS = "Buildings";
......
42 44
    public int facePolyCount = 0;
43 45
    public int faceErrorCount = 0;
44 46
    
47
    private static final Logger LOGGER = Logger.getLogger(Build.class);
48
    
45 49
    private int minGeneralVertexIndex;
46 50
    private int maxGeneralVertexIndex;
47 51
    private int minBuildingsVertexIndex;
......
455 459
    }
456 460

  
457 461
    public void doneParsingObj(URI filename) {
458
        System.err.println("Build.doneParsing: Loaded filename '" + filename + "' with " + verticesG.size() + " verticesG, " + verticesT.size() + " verticesT, " + verticesN.size() + " verticesN and " + faces.size() + " faces, of which " + faceTriCount + " triangles, " + faceQuadCount + " quads, and " + facePolyCount + " with more than 4 points, and faces with errors " + faceErrorCount);
462
        //System.err.println("Build.doneParsing: Loaded filename '" + filename + "' with " + verticesG.size() + " verticesG, " + verticesT.size() + " verticesT, " + verticesN.size() + " verticesN and " + faces.size() + " faces, of which " + faceTriCount + " triangles, " + faceQuadCount + " quads, and " + facePolyCount + " with more than 4 points, and faces with errors " + faceErrorCount);
463
        LOGGER.info(">>> Build.doneParsing: Loaded filename '" + filename + "' with " + verticesG.size() + " verticesG, " + verticesT.size() + " verticesT, " + verticesN.size() + " verticesN and " + faces.size() + " faces, of which " + faceTriCount + " triangles, " + faceQuadCount + " quads, and " + facePolyCount + " with more than 4 points, and faces with errors " + faceErrorCount);
459 464
    }
460 465
    
461 466
    public int getNumberOfVertex() {
src/main/java/cz/agents/alite/tactical/util/objReader/ObjFileProcessing.java
2 2

  
3 3
import java.net.URI;
4 4
import java.net.URISyntaxException;
5
import org.apache.log4j.Logger;
5 6

  
6 7
public class ObjFileProcessing {
7 8

  
......
9 10
	
10 11
	private CollisionBoxesDetector collisionDetector;
11 12
	private CollisionBoxesDetector generalMeshDetector;
12
		
13
	private static final Logger LOGGER = Logger.getLogger(ObjFileProcessing.class);
14
	
13 15
	public ObjFileProcessing() {
14 16
		this.collisionDetector = null;
15 17
		this.generalMeshDetector = null;
......
24 26
		} catch (URISyntaxException e1) {
25 27
			e1.printStackTrace();
26 28
		}
27
		System.err.println("LOADING FILE " + uri);
29
		LOGGER.info(">>> LOADING FILE: " + uri);
30
		long begin = System.currentTimeMillis();
28 31
        try {
29 32
        	builder = new Build();
30 33
        	new Parse(builder, uri);
......
42 45
        	generalMeshDetector = new CollisionBoxesDetector(builder, builder.getMinGeneralFaceIndex(), builder.getMaxGeneralFaceIndex(), builder.getMinGeneralVertexIndex(), builder.getMaxGeneralVertexIndex());
43 46
        	generalMeshDetector.startDetection();
44 47
        }
45
        
48
        long end = System.currentTimeMillis();
49
        long result = end - begin;
50
        LOGGER.info(">>> LOADING COMPLETED IN: " + result + " millisecond(s)");
46 51
        
47 52
	}
48 53
	
src/main/java/cz/agents/alite/tactical/util/objReader/Parse.java
3 3
import java.io.*;
4 4
import java.net.URI;
5 5

  
6
import org.apache.log4j.Logger;
7

  
6 8
public class Parse {
7 9

  
8 10
    // Tokens for parsing. 
......
48 50
    public final static String MTL_REFL_TYPE_CUBE_RIGHT = "cube_right";
49 51
    BuilderInterface builder = null;
50 52
    File objFile = null;
53
    
54
    private static final Logger LOGGER = Logger.getLogger(Parse.class);
51 55

  
52 56
    public Parse(BuilderInterface builder, URI filename) throws FileNotFoundException, IOException {
53 57
        this.builder = builder;
......
115 119
            } else if (line.startsWith(OBJ_MTLLIB)) {
116 120
                processMaterialLib(line);
117 121
            } else {
118
                System.err.println("Parse.parseObjFile: line " + lineCount + " unknown line |" + line + "|");
122
            	LOGGER.info(">>> Parse.parseObjFile: line " + lineCount + " unknown line |" + line + "|");
119 123
            }
120 124
            lineCount++;
121 125
        }
122 126
        bufferedReader.close();
123

  
124
        System.err.println("Loaded " + lineCount + " lines");
127
        LOGGER.info(">>> Parse.parseObjFile: Loaded " + lineCount + " lines");
125 128
    }
126 129

  
127 130
    private void processVertex(String line) {
......
271 274
            } else if (line.startsWith(MTL_REFL)) {
272 275
                processRefl(line);
273 276
            } else {
274
                System.err.println("Parse.parseMtlFile: line " + lineCount + " unknown line |" + line + "|");
275

  
277
                LOGGER.info(">>> Parse.parseMtlFile: line " + lineCount + " unknown line |" + line + "|");
276 278
            }
277 279
            lineCount++;
278 280
        }
279 281
        bufferedReader.close();
280

  
281
        System.err.println("Parse.parseMtlFile: Loaded " + lineCount + " lines");
282
        LOGGER.info(">>> Parse.parseMtlFile: Loaded " + lineCount + " lines");
282 283
    }
283 284

  
284 285
    private void processNewmtl(String line) {

Also available in: Unified diff