Forked from
Eclipse Projects / Eclipse openpass / opSimulation
1723 commits behind the upstream repository.
-
Dmitri Fix authored
upgrade and reorganize gui; cmake for gui; add plugins for time series plot and statistics; extend project plugin functionality (generic sim start); exclude two unused plugins from build; apply clang style
Dmitri Fix authoredupgrade and reorganize gui; cmake for gui; add plugins for time series plot and statistics; extend project plugin functionality (generic sim start); exclude two unused plugins from build; apply clang style
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
RandomInterface.h 1.17 KiB
/******************************************************************************
* Copyright (c) 2017 Volkswagen Group of America.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
//-----------------------------------------------------------------------------
//! @file RandomInterface.h
//! @brief ...
//!
//-----------------------------------------------------------------------------
#ifndef RANDOMINTERFACE_H
#define RANDOMINTERFACE_H
#include <QDateTime>
#include <QtGlobal>
class RandomInterface
{
public:
explicit RandomInterface() = delete;
virtual ~RandomInterface() = default;
public:
static void initialize()
{
qsrand(QDateTime::currentMSecsSinceEpoch());
}
static double random(double const &minimum = 0.0,
double const &maximum = 1.0)
{
return (static_cast<double>(qrand()) / RAND_MAX * (maximum - minimum)) + minimum;
}
};
#endif // RANDOMINTERFACE_H