Example #1
0
NDGrid<T,N>::NDGrid(const NDGrid<T,N>& src)
{
	copyFrom(src);
}
RealTimeSampleArrayMetricState & RealTimeSampleArrayMetricState:: operator=(const RealTimeSampleArrayMetricState & object) {
	copyFrom(object);
	return *this;
}
Example #3
0
QDropboxFileInfo &QDropboxFileInfo::operator=(const QDropboxFileInfo &other)
{
    copyFrom(other);
    return *this;
}
sendableMDNInfos::sendableMDNInfos(const sendableMDNInfos& other)
	: MDNInfos()
{
	copyFrom(other);
}
bodyPart& bodyPart::operator=(const bodyPart& other)
{
	copyFrom(other);
	return (*this);
}
Example #6
0
Clipboard &
Clipboard::operator=(const Clipboard &c)
{
    copyFrom(&c);
    return *this;
}
Example #7
0
void BinaryData::copyFrom(BinaryDataRef const & bdr)
{
   copyFrom( bdr.getPtr(), bdr.getSize() );
}
 TriggerParameterNumberAll(const TriggerParameterNumberAll& rhs) : TriggerParameterBase(rhs) { copyFrom(rhs); }
 TriggerParameterNumberAll& operator=(const TriggerParameterNumberAll& rhs)
 {
     if ( &rhs != this ) copyFrom(rhs);
     return *this;
 }
Example #10
0
contentDisposition& contentDisposition::operator=(const contentDisposition& other)
{
	copyFrom(other);
	return (*this);
}
Example #11
0
void test()
{
	//void main()
	

	int board_state[] = {
		1, 0, 0, 0, 5, 0, 0, 5, 0, 5, 5,
		0, 0, 0, 0, 5, 0, 5, 0, 0, 5, 5,
		0, 0, 0, 0, 0, 5, 0, 0, 5, 5, 5,
		0, 0, 5, 0, 0, 5, 5, 5, 5, 5, 5,
		0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0,
		0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 5,
		5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 5,
		0, 0, 0, 0, 0, 0, 5, 5, 3, 5, 5,
		5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
		5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
	};//               |

	auto b = copyFrom(board_state);
	unsigned int* rBoard = b->cells;

	float total = 0;
	system("pause");

	for (int i = 0; i < 45; ++i)
	{

		FILETIME now;
		GetSystemTimeAsFileTime(&now);
		LONGLONG now1 = (LONGLONG)now.dwLowDateTime + ((LONGLONG)(now.dwHighDateTime) << 32LL);

		int maxDepth = deepMove_ia(rBoard, 8, 8, 0, 100, false);

		GetSystemTimeAsFileTime(&now);
		LONGLONG now2 = (LONGLONG)now.dwLowDateTime + ((LONGLONG)(now.dwHighDateTime) << 32LL);

		int maxDepth2 = deepMove(b, 8, 8, 0, 100, false);

		GetSystemTimeAsFileTime(&now);
		LONGLONG now3 = (LONGLONG)now.dwLowDateTime + ((LONGLONG)(now.dwHighDateTime) << 32LL);

		//printf("Max Depth iterative = %d, time = %lld\n", maxDepth, now2 - now1);
		//printf("Max Depth recursive = %d, time = %lld\n", maxDepth2, now3 - now2);
		float rate = (now2 - now1) / (float)(now3 - now2);
		//printf("Ratio iterative/recursive = %f\n", rate);
		total += rate;
	}

	printf("end test, rate = %f", total / 45);
	getchar();

	//extern int evaluateBoard(board* b, const Position& myPos, const Position& opPos);
	Position myPos = Position(0, 0);
	Position opPos = Position(8, 8);
	
	for (int y = 0; y < MAP_SIZE; ++y)
	{
		for (int x = 0; x < MAP_SIZE; ++x)
		{
			printf("%d  ", board_state[CONVERT_COORD(x, y)]);
		}
		printf("\n\n");
	}

	while (true)
	{
		FILETIME ft_now;
		GetSystemTimeAsFileTime(&ft_now);
		LONGLONG ll_now = (LONGLONG)ft_now.dwLowDateTime + ((LONGLONG)(ft_now.dwHighDateTime) << 32LL);

		int dir = AiMove(board_state, myPos, opPos);

		GetSystemTimeAsFileTime(&ft_now);
		LONGLONG ll_now2 = (LONGLONG)ft_now.dwLowDateTime + ((LONGLONG)(ft_now.dwHighDateTime) << 32LL);
		printf("Player1: time = %lld, dir = %d\n", (ll_now2 - ll_now) / 10000, dir);
		board_state[CONVERT_COORD(myPos.x, myPos.y)] = BLOCK_PLAYER_1_TRAIL;
		switch (dir)
		{
		case 1:
			myPos.x--;
			break;
		case 2:
			myPos.y--;
			break;
		case 3:
			myPos.x++;
			break;
		case 4:
			myPos.y++;
			break;
		default:
			break;
		}
		board_state[CONVERT_COORD(myPos.x, myPos.y)] = BLOCK_PLAYER_1;
		for (int y = 0; y < MAP_SIZE; ++y)
		{
			for (int x = 0; x < MAP_SIZE; ++x)
			{
				printf("%d  ", board_state[CONVERT_COORD(x, y)]);
			}
			printf("\n\n");
		}

		//int charCode = 0;
		//do
		//{
		//	printf("Your move: ");
		//	charCode = getchar();
		//	while (getchar() != '\n'){}
		//}
		//while (charCode != 'a' && charCode != 's' && charCode != 'd' && charCode != 'w');
		//board_state[CONVERT_COORD(opPos.x, opPos.y)] = BLOCK_PLAYER_2_TRAIL;
		//switch (charCode)
		//{
		//case 'a':
		//	opPos.x--;
		//	break;
		//case 'w':
		//	opPos.y--;
		//	break;
		//case 'd':
		//	opPos.x++;
		//	break;
		//case 's':
		//	opPos.y++;
		//	break;
		//default:
		//	break;
		//}
		//board_state[CONVERT_COORD(opPos.x, opPos.y)] = BLOCK_PLAYER_2;

		printf("Press Enter to move next ");
		while (getchar() != '\n');

		GetSystemTimeAsFileTime(&ft_now);
		ll_now = (LONGLONG)ft_now.dwLowDateTime + ((LONGLONG)(ft_now.dwHighDateTime) << 32LL);

		dir = AiMove(board_state, opPos, myPos);

		GetSystemTimeAsFileTime(&ft_now);
		ll_now2 = (LONGLONG)ft_now.dwLowDateTime + ((LONGLONG)(ft_now.dwHighDateTime) << 32LL);
		printf("Player2: time = %lld, dir = %d\n", (ll_now2 - ll_now) / 10000, dir);
		board_state[CONVERT_COORD(opPos.x, opPos.y)] = BLOCK_PLAYER_2_TRAIL;
		switch (dir)
		{
		case 1:
			opPos.x--;
			break;
		case 2:
			opPos.y--;
			break;
		case 3:
			opPos.x++;
			break;
		case 4:
			opPos.y++;
			break;
		default:
			break;
		}
		board_state[CONVERT_COORD(opPos.x, opPos.y)] = BLOCK_PLAYER_2;

		for (int y = 0; y < MAP_SIZE; ++y)
		{
			for (int x = 0; x < MAP_SIZE; ++x)
			{
				printf("%d  ", board_state[CONVERT_COORD(x, y)]);
			}
			printf("\n\n");
		}
	}

}
WorkflowContextDescriptor & WorkflowContextDescriptor:: operator=(const WorkflowContextDescriptor & object) {
	copyFrom(object);
	return *this;
}
Example #13
0
// Construct a copy of a graph from a given graph
digraph::digraph(const digraph& G) : graph(G) {
    makeSpace();
    copyFrom(G);
}
Example #14
0
void digraph::cFrom(const digraph& G) {
    graph::cFrom(G);
    copyFrom(G);
}
Example #15
0
void MemoryBlock::copyFrom(MemoryBlock *src) {
	copyFrom(src, 0, 0, src->size());
}
Example #16
0
charset& charset::operator=(const charset& other)
{
	copyFrom(other);
	return (*this);
}
Example #17
0
Clipboard::Clipboard(const Clipboard &c) :
    m_partial(false)
{
    copyFrom(&c);
}
Example #18
0
void
PasteUndoCommand::undo()
{
    copyFrom(_imp->originalSerialization->getKnob(), false);
} // undo
Example #19
0
BinaryData::BinaryData(BinaryDataRef const & bdRef) 
{ 
   copyFrom(bdRef.getPtr(), bdRef.getSize());
}
Example #20
0
void
PasteUndoCommand::redo()
{
    copyFrom(_imp->fromKnob, true);
} // undo
SecureBinaryData & SecureBinaryData::operator=(SecureBinaryData const & sbd2)
{ 
   copyFrom(sbd2.getPtr(), sbd2.getSize() );
   lockData(); 
   return (*this);
}
context& context::operator=(const context& ctx)
{
	copyFrom(ctx);
	return *this;
}
sendableMDNInfos& sendableMDNInfos::operator=(const sendableMDNInfos& other)
{
	copyFrom(other);
	return (*this);
}
Example #24
0
TTsentence::TTsentence(const TTsentence *src) : _sentenceConcept(src->_sentenceConcept),
		_initialLine(src->_initialLine), _normalizedLine(src->_normalizedLine) {
	copyFrom(*src);
}
Example #25
0
 /**
  * @brief Database::Database
  * @param src
  */
 Database::Database(const Database &src)
 {
     copyFrom(src);
 }
Example #26
0
WorkflowDetail & WorkflowDetail:: operator=(const WorkflowDetail & object) {
	copyFrom(object);
	return *this;
}
Example #27
0
QDropboxFileInfo::QDropboxFileInfo(const QDropboxFileInfo &other) :
    QDropboxJson(0)
{
    _init();
    copyFrom(other);
}
Example #28
0
headerField& headerField::operator=(const headerField& other)
{
	copyFrom(other);
	return (*this);
}
ActivateOperationDescriptor & ActivateOperationDescriptor:: operator=(const ActivateOperationDescriptor & object) {
	copyFrom(object);
	return *this;
}
parameter& parameter::operator=(const parameter& other)
{
	copyFrom(other);
	return (*this);
}