Example #1
0
void CScreen::printResult(const int number, const int depth, const int selectivity, const uint64_t P, const uint64_t O, const int score, const std::chrono::milliseconds duration, const uint64_t NodeCounter, const std::string& PV)
{
	positionCounter.fetch_add(1, std::memory_order_relaxed);

	if (verbose == 1)
	{
		if (!flag.test_and_set(std::memory_order_acquire))
		{
			if (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - lastPrint).count() > 500)
			{
				if (positions)
				{
					std::unique_lock<std::mutex> lock(mtx);
					std::cout << "\r" << ThousandsSeparator(positionCounter.load(std::memory_order_acquire)) << " positions solved.   " << positionCounter.load(std::memory_order_acquire) * 100 / positions << "%    " << ETA();
					fflush(stdout);
				}
				else
				{
					std::unique_lock<std::mutex> lock(mtx);
					std::cout << "\r" << ThousandsSeparator(positionCounter.load(std::memory_order_acquire)) << " positions solved in             " << time_format(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - startTime));
					fflush(stdout);
				}
				lastPrint = std::chrono::high_resolution_clock::now();
			}
			flag.clear(std::memory_order_release);
		}
	}
	else if (verbose == 2)
	{
		std::unique_lock<std::mutex> lock(mtx);
		printf("%*d|%6s| %+2.2d |%16s|%*s|%*s| %s\n", width_number, number, DepthSelectivity(depth, selectivity, P, O).c_str(), score,
			time_format(duration).c_str(), width_nodes, ThousandsSeparator(NodeCounter).c_str(),
			width_nps, (duration.count() == 0 ? nullptr : ThousandsSeparator(NodeCounter * 1000ULL / duration.count()).c_str()),
			PV.c_str());
	}
	else if (verbose == 3)
	{
		std::string L1, L2;
		GetLines(L1, L2);
		std::unique_lock<std::mutex> lock(mtx);
		std::cout << L2 << std::endl;
	}
}
Example #2
0
$PARAM CL = 1, V = 20, KA=1.1
$CMT DEPOT CENT
$PKMODEL ncmt=1, depot = TRUE,trans=1
$OMEGA 0 0 0
labels=s(ECL,EV,EKA)
$TABLE
double CP = CENT/pred_V;
$CAPTURE CP
$MAIN
pred_CL   = CL*exp(ETA(1));
pred_V    = V *exp(ETA(2));
pred_KA   = KA*exp(ETA(3));
Example #3
0
$PARAM CL = 1, V1 = 8, Q = 1, V2 = 100

$CMT CENT PERIPH

$PKMODEL ncmt=2, depot = FALSE,trans=1

$OMEGA 0 0 0 0
labels=s(ECL,EV2,EQ,EV3)

$TABLE
double CP = CENT/pred_V2;

$CAPTURE CP

$MAIN
pred_CL = CL*exp(ETA(1));
pred_V2 = V1*exp(ETA(2));
pred_Q  = Q *exp(ETA(3));
pred_V3 = V2*exp(ETA(4));
Example #4
0
std::pair<int, int> Fleet::ETA() const
{ return ETA(MovePath()); }