public void act() 
    {
        moveTrain();
        requestNewWagon();
        if(trainHasToStop())
        {
            speed = 0;
        }
        if(allWagonsLoaded()){
            speed = 1;
        }
        if(isAtEdge())
        {
            
            addNewTrain();
            
        }
    }