OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006 Georgia Tech Research Corporation | 3 * Copyright (c) 2006 Georgia Tech Research Corporation |
4 * Copyright (c) 2011 Mathieu Lacage | 4 * Copyright (c) 2011 Mathieu Lacage |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 virtual ~DeterministicRandomVariable (); | 2374 virtual ~DeterministicRandomVariable (); |
2375 | 2375 |
2376 /** | 2376 /** |
2377 * \brief Sets the array of values that holds the predetermined sequence. | 2377 * \brief Sets the array of values that holds the predetermined sequence. |
2378 * \param [in] values Array of random values to return in sequence. | 2378 * \param [in] values Array of random values to return in sequence. |
2379 * \param [in] length Number of values in the array. | 2379 * \param [in] length Number of values in the array. |
2380 * | 2380 * |
2381 * Note that the values in the array are copied and stored | 2381 * Note that the values in the array are copied and stored |
2382 * (deep-copy). | 2382 * (deep-copy). |
2383 */ | 2383 */ |
2384 void SetValueArray (double* values, uint64_t length); | 2384 void SetValueArray(double* values, std::size_t length); |
2385 | 2385 |
2386 /** | 2386 /** |
2387 * \brief Returns the next value in the sequence. | 2387 * \brief Returns the next value in the sequence. |
2388 * \return The floating point next value in the sequence. | 2388 * \return The floating point next value in the sequence. |
2389 */ | 2389 */ |
2390 virtual double GetValue (void); | 2390 virtual double GetValue (void); |
2391 | 2391 |
2392 /** | 2392 /** |
2393 * \brief Returns the next value in the sequence. | 2393 * \brief Returns the next value in the sequence. |
2394 * \return The integer next value in the sequence. | 2394 * \return The integer next value in the sequence. |
2395 */ | 2395 */ |
2396 virtual uint32_t GetInteger (void); | 2396 virtual uint32_t GetInteger (void); |
2397 | 2397 |
2398 private: | 2398 private: |
2399 /** Position in the array of values. */ | 2399 /** Size of the array of values. */ |
2400 uint64_t m_count; | 2400 std::size_t m_count; |
2401 | 2401 |
2402 /** Position of the next value in the array of values. */ | 2402 /** Position of the next value in the array of values. */ |
2403 uint64_t m_next; | 2403 std::size_t m_next; |
2404 | 2404 |
2405 /** Array of values to return in sequence. */ | 2405 /** Array of values to return in sequence. */ |
2406 double* m_data; | 2406 double* m_data; |
2407 | 2407 |
2408 }; // class DeterministicRandomVariable | 2408 }; // class DeterministicRandomVariable |
2409 ·· | 2409 ·· |
2410 | 2410 |
2411 /** | 2411 /** |
2412 * \ingroup randomvariable | 2412 * \ingroup randomvariable |
2413 * \brief The Random Number Generator (RNG) that has a specified empirical distr
ibution. | 2413 * \brief The Random Number Generator (RNG) that has a specified empirical distr
ibution. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2542 bool m_validated; | 2542 bool m_validated; |
2543 /** The vector of CDF points. */ | 2543 /** The vector of CDF points. */ |
2544 std::vector<ValueCDF> m_emp; | 2544 std::vector<ValueCDF> m_emp; |
2545 | 2545 |
2546 }; // class EmpiricalRandomVariable | 2546 }; // class EmpiricalRandomVariable |
2547 ·· | 2547 ·· |
2548 | 2548 |
2549 } // namespace ns3 | 2549 } // namespace ns3 |
2550 | 2550 |
2551 #endif /* RANDOM_VARIABLE_STREAM_H */ | 2551 #endif /* RANDOM_VARIABLE_STREAM_H */ |
OLD | NEW |