16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 18:39:18 +02:00

merged upstream changes

This commit is contained in:
tmj-fstate
2017-01-26 19:09:59 +01:00
8 changed files with 228 additions and 218 deletions

View File

@@ -13,6 +13,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
*/
#include "stdafx.h"
#include "mctools.h"
#include "Globals.h"
/*================================================*/
@@ -133,6 +134,12 @@ bool UnSetFlag(int &Flag, int Value)
return true;
}
inline double Random(double a, double b)
{
std::uniform_real_distribution<> dis(a, b);
return dis(Global::random_engine);
}
bool FuzzyLogic(double Test, double Threshold, double Probability)
{
if ((Test > Threshold) && (!DebugModeFlag))
@@ -458,7 +465,7 @@ void ComputeArc(double X0, double Y0, double Xn, double Yn, double R, double L,
{
double dX;
double dY;
double Xc;
double Xc;
double Yc;
double gamma;
double alfa;

View File

@@ -68,16 +68,11 @@ inline long Round(float f)
//return lround(f);
}
inline int Random()
{
std::srand(std::time(NULL));
return std::rand();
}
extern double Random(double a, double b);
inline double Random(double a, double b)
inline double Random()
{
std::srand(std::time(NULL));
return a + std::rand() / (float)RAND_MAX * (b - a);
return Random(0.0,1.0);
}
inline double Random(double b)