///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Copyright (C) 2006 by Intel Coproration and Carnegie Mellon University    //
// Contacts: casey.j.helfrich @ intel.com                                    //
//           bdr @ cs.cmu.edu                                                //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include <iostream>
#include <errno.h>
#include <string.h>

#include "RandomValue.hxx"
#include "CatomSim.hxx"
#include "CatomWorld.hxx"

CODE_MODULE_DECLARATION( RandomValue, RandomValue );

using namespace std;

void RandomValue::simulationStart() { signpost dprdebug_block_signpost(__FILE__,__LINE__,__FUNCTION__); 
	value = 0;
}

void RandomValue::newTick() { signpost dprdebug_block_signpost(__FILE__,__LINE__,__FUNCTION__); 
	value = rand() % 2;
	if (value) {
  	worldPtr->catomHash[hostCatom]->red = 255;
	  worldPtr->catomHash[hostCatom]->green = 255;
	  worldPtr->catomHash[hostCatom]->blue = 0;
		worldPtr->catomHash[hostCatom]->alpha = 100;
	}
	else {
		worldPtr->catomHash[hostCatom]->red = 0;
	  worldPtr->catomHash[hostCatom]->green = 0;
	  worldPtr->catomHash[hostCatom]->blue = 0;
		worldPtr->catomHash[hostCatom]->alpha = 100;
	}

}

void RandomValue::endTick() { signpost dprdebug_block_signpost(__FILE__,__LINE__,__FUNCTION__); 

}
