public void sync(SolutionAcceptor solutionAcceptor, float temp, boolean end) {
		for (int i = 0; i < N_THREADS; i++) {
			try {
				threadsReady.acquire();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

		try {
			bestResultSem.acquire();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

		this.end = end;
		this.currentTemp = temp;
		currentOrder = new ArrayList<>();
		currentOrder.addAll(bestResult.getPackages());

		for (int i = 0; i < N_THREADS; i++) {
			processPermit.release();
		}
		
		if (bestResult.compareTo(lastSaved) > 0) {
			OutputStream outputStream = solutionAcceptor
					.newSolutionOutputStream();

			if (outputStream != null) {
				CarriersCollection collection = new CarriersCollection(
						warehouse.getPallets(), warehouse.getPackages());
				collection.setOrder(bestResult.getPackages());
				collection.save(outputStream);
			}
			lastSaved = bestResult;
		}
		
		bestResultSem.release();
	}