task main()
{
	initializeRobot();
	waitForStart(); // Wait for the beginning of autonomous phase.
	liftMove(50, 1000);
  moveDist(115, 100, SPEED);//Moves forward
  turnDeg(45, TURN_RIGHT, 100, SPEED);//Turns right
  moveDist(47, 100, SPEED);//Moves forward
}
Beispiel #2
0
        float ScoreMove(int j1, int j2, int obs)
        {
            if (j1 == j2)
            {
                float trans = pStay(j1);
                float em = stayDist(obs, j1);
                return log(trans * em);
            }
            else if (j1 + 1 == j2)
            {
                float ps = pStay(j1);
                float pm = (1.0f - ps) * pMerge(j1);
                float trans = 1.0f - ps - pm;

                float em = moveDist(obs, j1);
                return log(trans * em);
            }
            else if (j1 + 2 == j2)
            {
                float ps = pStay(j1);
                float pm = (1.0f - ps) * pMerge(j1);

                if (obs == templateBase(j1))
                    return log(pm);

                else
                    return NEG_INF;
            }

            return NEG_INF;
        }
Beispiel #3
0
        float Inc(int i, int j) const
        {
            assert(0 <= j && j < TemplateLength() &&
                   0 <= i && i < ReadLength() );

            float ps = pStay(j);
            float pm = (1.0f - ps) * pMerge(j);
            float trans = 1.0f - ps - pm;

            float em = moveDist(features_.Channel[i], j);
            return log(trans * em);
        }
Beispiel #4
0
        float Del(int i, int j) const
        {
            assert(0 <= j && j < TemplateLength() &&
                   0 <= i && i <= ReadLength() );
            if ( (!PinStart() && i == 0) || (!PinEnd() && i == ReadLength()) )
            {
                return 0.0f;
            }
            else
            {
                float ps = pStay(j);
                float pm = (1.0f - ps) * pMerge(j);
                float trans = 1.0f - ps - pm;

                float em = moveDist(0, j);
                return log(trans * em);
            }
        }
void CGUITextureCacheBrowser::updateImageList()
{
	if (!Panel)
		return;

	video::IVideoDriver* Driver = Environment->getVideoDriver();

	// clear images
	u32 i;
	for (i=0; i<Images.size(); ++i)
	{
		Images[i]->drop();
		Images[i]->remove();
	}
	Images.clear();

	u32 count = (u32)Driver->getTextureCount();

	s32 h = Panel->getClientArea().getWidth()-10;
	s32 hw = h/2;
	core::rect<s32> pos(Panel->getClientArea().getCenter().X - Panel->getAbsolutePosition().UpperLeftCorner.X - hw, 5, 
						Panel->getClientArea().getCenter().X - Panel->getAbsolutePosition().UpperLeftCorner.X + hw, h+5);

	core::position2di moveDist(0, h+5);

	for (u32 i=0; i<count; ++i)
	{
		core::stringw details;
		video::ITexture* tex = Driver->getTextureByIndex(i);
		details = L"File name: ";
		details += tex->getName().c_str();
		details += L"\nFormat: ";
		video::ECOLOR_FORMAT cf = tex->getColorFormat();

		bool alpha = false;

		switch (cf)
		{
		case video::ECF_A1R5G5B5:
			details += L"A1R5G5B5 (16-bit with 1-bit alpha channel)\n";
			alpha = true;
			break;
		case video::ECF_R5G6B5:
			details += L"R5G6B5 (16-bit, no alpha channel)\n";
			break;
		case video::ECF_R8G8B8:
			details += L"R8G8B8 (16-bit, no alpha channel)\n";
			break;
		case video::ECF_A8R8G8B8:
			details += L"R8G8B8 (32-bit with 8-bit alpha channel)\n";
			alpha = true;
			break;
		default:
			details += L"Unknown\n";
		}

		core::dimension2di osize = tex->getOriginalSize();
		core::dimension2di size = tex->getOriginalSize();

		details += "Size: ";
		details += size.Width;
		details += "x";
		details += size.Height;

		if (osize != size)
		{
			details += "\nOriginal Size: ";
			details += osize.Width;
			details += "x";
			details += osize.Height;
		}

		details += L"\nMip-maps: ";

		if (tex->hasMipMaps())
			details += L"Yes\n";
		else
			details += L"No\n";

		IGUIImage* img = Environment->addImage(tex, core::position2di(1,1), alpha, Panel, i);
		img->grab();
		Images.push_back(img);
		img->setRelativePosition(pos);
		img->setToolTipText(details.c_str());
		img->setScaleImage(true);
		img->setColor( SelectedTexture == i ? video::SColor(255,255,255,255) : video::SColor(128,128,128,128) );

		pos = pos + moveDist;
	}
}