Deleted Added
sdiff udiff text old ( 9524:d6ffa982a68b ) new ( 9584:1a21964b7227 )
full compact
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 310 unchanged lines hidden (view full) ---

319TrafficGen::StateGraph::transition()
320{
321 // exit the current state
322 states[currState]->exit();
323
324 // determine next state
325 double p = random_mt.gen_real1();
326 assert(currState < transitionMatrix.size());
327 double cumulative = transitionMatrix[currState][0];
328 size_t i = 1;
329 while (p < cumulative && i != transitionMatrix[currState].size()) {
330 cumulative += transitionMatrix[currState][i];
331 ++i;
332 }
333 enterState(i);
334}
335
336void
337TrafficGen::StateGraph::enterState(uint32_t newState)
338{
339 DPRINTF(TrafficGen, "Transition to state %d\n", newState);
340
341 currState = newState;

--- 276 unchanged lines hidden ---