Beispiel #1
0
/** Run the simulation contained in the simulation WorkPacket 'simpacket'
    in the current thread */
Simulation Simulation::run( const SimPacket &simpacket )
{
    Nodes nodes;
    
    ThisThread this_thread = nodes.borrowThisThread();
    
    if (nodes.isEmpty())
        throw SireError::unavailable_resource( QObject::tr(
            "This thread is unavailable for running a simulation. It is already "
            "busy doing something else!"), CODELOC );
            
    Node node = nodes.getNode();
    
    Simulation sim = Simulation::run(node, simpacket);
    
    sim.wait();
    
    return sim;
}