Пример #1
0
/**
* Run the simulation taking stats for some batches.
*
* The simulation are split in three phases:
* Warm-up, Convergency assurement & Stationary state.
* 
* @see warm_up()
* @see convergency()
* @see stationary()
*/
void run_network_batch(void){
	warm_up();
	convergency();
	stationary();
}
Пример #2
0
void Composition::update(){
    if(track == 1){
        stationary(false);
        if(status == 1){
            g.update();
        } else if (status == 2){
            g.update();
            for(int i=0; i<vines.size(); i++){
                vines[i].update();
            }
        } else if (status == 3){
            g.update();
            for(int i=0; i<vines.size(); i++){
                vines[i].update();
            }
        } else if (status == 4){
            if(g.fadeNow) {stationary(true);}
            if(g.resetLights){
                pointLight.setSpotlight(1200.0, 200.0);
                pointLight2.setSpotlight(1200.0, 200.0);
            }
            g.update();
            for(int i=0; i<vines.size(); i++){
                vines[i].update();
                vines[i].wither();
            }
        }
    } else if (track == 2){
        moving();
        ofPushMatrix();
        if(status == 1){
            line1.update(attack01*2, started);
            line2.update(attack02, started);
        } else if (status == 2){
            for(int i=0; i<darts.size(); i++){
                darts[i].state = 0;
                darts[i].pos = darts[i].pos * 0.995 + line1.pos * 0.005;
                darts[i].update();
            }
        } else if (status == 3){
            for(int i=0; i<darts.size(); i++){
                darts[i].state = 1;
                darts[i].pos = darts[i].pos * 0.9 + ofVec3f(ofRandom(ofGetWidth()), ofRandom(ofGetHeight()), ofRandom(ofGetWidth()))*0.1;
                darts[i].update();
            }
        } else if (status == 4){
            stationary(false);
            g.update();
//            line1.updatePiece();
//            line2.updatePiece();

        } else if (status == 5){
            stationary(false);
            g.update();
            for(int i=0; i<vines.size(); i++){
                vines[i].update();
            }
        } else if (status == 6){
            stationary(false);
            g.update();
            for(int i=0; i<vines.size(); i++){
                vines[i].update();
                vines[i].wither();
            }
            for(int i=0; i<darts.size(); i++){
                darts[i].state = 0;
                darts[i].pos = darts[i].pos * 0.995 + ofVec3f(ofGetWidth()/2,ofGetHeight(),0) * 0.005;
                darts[i].update();
            }
        } else if (status == 7){
            stationary(false);
            g.update();
        } else if (status == 8){
            stationary(true);
            g.update();
        } else if (status == 9){
            stationary(false);
            g.update();
            
        }

        ofPopMatrix();
    } else if (track == 3){
        if (status == 1){
            
        } else if (status == 2){
            
        } else if (status == 3){
            
        } else if (status == 4){
            
        }
    } else if (track == 4){
        if (status == 1){
            
        } else if (status == 2){
            
        } else if (status == 3){
            
        }
    }
}