private String runTest(boolean restrict) {
		String log = "\nTest #" + totalTests + "\n";
		try {
			Random rnd = new Random();
			Puzzle p = new Puzzle(randomPuzzle(maxDepth + rnd.nextInt(maxDepth / 2)), restrict, null);		//generate puzzles with depth of solution in [7,20]
			log += "Initial state: " + p.toString() + "\n";
			Counter c = new Counter(p, "Next test started\n");
			new Thread(c).start();
			try {
				boolean res = false;
				if (type == 0) res = p.BFS();
				else if (type == 1) res = p.RBFS();
				if (res) {
					successfulTests++;
					log += "Action sequence:\n" + p.getResult();
				} else {
					log += "Solution not found\n";
				}
			} catch (MyOutOfMemoryException e) {
				log += "Out of memory\n";
			} catch (MyOutOfTimeException e) {
				log += "Out of time\n";
			} finally {
				s[totalTests] = p.getStatistics();
				log += "Nodes created: " + s[totalTests].nodesCreated + "\n";
				log += "Nodes in memory: " + s[totalTests].nodesInMemory + "\n";
				log += "Total time: " + (double)s[totalTests].totalTime/1000 + " s\n";
			}
			c.stop();
			System.out.println("Test #" + totalTests + " completed\n");
			totalTests++;
		} catch (MyException e) {
			System.out.println(e.getMessage());
			log = "\n" + e.getMessage();
		}
		return log;
	}