Sampler¤Ë¤è¤ë¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥Á¥å¡¼¥Ë¥ó¥°

Sampler¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀ­Ç½¤Ë´Ø¤¹¤ëÌäÂê¤òÈ¯¸«¤¹¤ë¤¿¤á¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤¹¡£Sampler¤Ï¤³¤Î°Ù¤Ë¡¢°ìÄê»þ´Ö¥×¥í¥°¥é¥à¤Î¥³¡¼¥ë¥¹¥¿¥Ã¥¯¤ò¥µ¥ó¥×¥ê¥ó¥°¤·¤Æ¡¢¤½¤Î·ë²Ì¤ò¥Ö¥é¥¦¥¶¤ËÉ½¼¨¤·¤Þ¤¹¡£

¥µ¥ó¥×¥ê¥ó¥°¤ò»Ï¤á¤ë¤Ë¤Ï¡¢¡Ö³«»Ï¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£pid(¥×¥í¥»¥¹ID)¤¬»ØÄê¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥µ¥ó¥×¥ê¥ó¥°¤Ï¤¹¤°¤Ë³«»Ï¤µ¤ì¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¡Ö¥×¥í¥»¥¹¤ò¥ª¡¼¥×¥ó¡×¥Ñ¥Í¥ë¤¬É½¼¨¤µ¤ì¥µ¥ó¥×¥ê¥ó¥°ÂÐ¾Ý¤Î¥×¥í¥»¥¹¤òÁªÂò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°ìÅÙ³«»Ï¤·¤Æ¤·¤Þ¤¨¤Ð¡¢¡Ö³«»Ï¡×¥Ü¥¿¥ó¤Ï¡ÖÄä»ß¡×¥Ü¥¿¥ó¤ËÊÑ¤ï¤ê¤Þ¤¹¡£¡ÖÄä»ß¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Î¥µ¥ó¥×¥ê¥ó¥°¤ò½ªÎ»¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¡Ö»þ´Ö´Ö³Ö¡×¥Õ¥£¡¼¥ë¥É¤Ï³Æ¥µ¥ó¥×¥ë´Ö¤Î»þ´Ö(¥ß¥êÉÃ)¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï20ms¤Ç¤¹¡£

¼ý½¸¤µ¤ì¤¿¥µ¥ó¥×¥ë¤Î¥Ö¥é¥¦¥¸¥ó¥°

°ìÅÙ¥µ¥ó¥×¥ë¤¬¼ý½¸¤µ¤ì¤ë¤È¡¢¤½¤Î¥Ç¡¼¥¿¤òtree(ÌÚ¹½Â¤)¤Èflat(¥Õ¥é¥Ã¥È¹½Â¤)¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£tree¥â¥Ç¥ë¤Ï main()¤Þ¤¿¤Ï start()´Ø¿ô¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£¥Ö¥é¥¦¥¶Æâ¤Î¤³¤Î¥¨¥ó¥È¥ê¡¼¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¤½¤Î´Ø¿ô¤Î»Ò¤¬¼¡¤Î¥«¥é¥à¤ËÉ½¼¨¤µ¤ì¤Þ¤¹¡£

¬
³Æ¥Ö¥é¥¦¥¶¥¢¥¤¥Æ¥à¤Î¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤Ï¥µ¥ó¥×¥ê¥ó¥°¤·¤Æ¤¤¤ë´Ö¤Ë¸¡½Ð¤µ¤ì¤¿¥×¥í¥·¡¼¥¸¥ã¤Î²ó¿ô¤Ç¤¹¡£

¡Öflat¡×¥é¥¸¥ª¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤Èflat¥â¡¼¥É¤ËÊÑ¤ï¤ê¤Þ¤¹¡£¤³¤Î¥â¡¼¥É¤Ç¤Ï¤¹¤Ù¤Æ¤ÎÌÚ¹½Â¤¤¬¥Õ¥é¥Ã¥È¤Ë¤Ê¤ê¡¢¥µ¥ó¥×¥ë¥¹¥¿¥Ã¥¯Æâ¤Î¥×¥í¥·¡¼¥¸¥ã¤ÎÈ¯À¸²ó¿ô¤¬¥«¥¦¥ó¥È¤µ¤ì¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£

¬
¥Õ¥é¥Ã¥È¥â¡¼¥É¤Ç¥Ö¥é¥¦¥¶¥¢¥¤¥Æ¥à¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢¥¯¥ê¥Ã¥¯¤·¤¿¥Ö¥é¥¦¥¶¥¢¥¤¥Æ¥à°Ê²¼¤¬¥Õ¥é¥Ã¥È²½¤µ¤ì¤¿¥µ¥Ö¥Ä¥ê¡¼¤È¤·¤ÆÉ½¼¨¤µ¤ì¤Þ¤¹¡£

¼ý½¸¤·¤¿¥µ¥ó¥×¥ë¤Î¥Õ¥£¥ë¥¿¥ê¥ó¥°

¥Õ¥£¥ë¥¿µ¡¹½¤òÍøÍÑ¤·¤Æ¥µ¥ó¥×¥ê¥ó¥°¥Ç¡¼¥¿¤Î¿ô¤ò¸º¤é¤·¤Æ¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ö¥Õ¥£¥ë¥¿¡×¥á¥Ë¥å¡¼¤Î¡Ö¥Õ¥£¥ë¥¿¥Ñ¥Í¥ë¡×¥³¥Þ¥ó¥É¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡Ö¸¡º÷¡×¥Ñ¥Í¥ë¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

¬

¥Õ¥£¥ë¥¿¤ò¤«¤±¤¿¤¤¥Æ¥­¥¹¥È¤òÆþÎÏ¤·¤Æ¡Ö¥Õ¥£¥ë¥¿¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£¥Õ¥£¥ë¥¿¥ê¥ó¥°¤ò¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤Î¡Ö¥Õ¥£¥ë¥¿¡×¤Î¥Á¥§¥Ã¥¯¤ò³°¤·¤Æ¤ª¤­¤Þ¤¹¡£