| AI :: Menu. AI :: MENU´Â Áö½Ã µÈ ±×·¡ÇÁ¿¡¼ Æ®¸® :: NARY °´Ã¼ ¶Ç´Â ÇÔ¼ö ÁýÇÕÀÇ ¼³¸íÀ» »ý¼ºÇÏ´Â PERL °³Ã¼ÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
AI :: Menu. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~jsmith/Uttu-0.06/lib/Uttu/Manual/Intro.pod
AI :: Menu. ű×
AI :: Menu. ¼³¸í
AI :: Menu´Â Directed Graph ¶Ç´Â ÇÔ¼ö ¼¼Æ®ÀÇ ¼³¸í¿¡¼ Æ®¸® :: NARY °´Ã¼¸¦ »ý¼ºÇÏ´Â Perl °³Ã¼ÀÔ´Ï´Ù. AI :: Menu´Â Directed Graph ¶Ç´Â ÇÔ¼ö ÁýÇÕÀÇ ¼³¸í¿¡¼ Æ®¸® :: NARY °´Ã¼¸¦ »ý¼ºÇÏ´Â Perl °´Ã¼ÀÔ´Ï´Ù. ¾Ë°í¸®ÁòÀº ¸Å¿ì È¿À²ÀûÀÌÁö ¾Ê½À´Ï´Ù (´ë·« O (f ^ 6) f ÇÔ¼ö Ƚ¼ö°¡µË´Ï´Ù). ±×°ÍÀº ¶ÇÇÑ ±×°ÍÀÌ ÇؾßÇϴ¸¸Å Áö´ÉÀûÀÎ °ÍÀº ¾Æ´Õ´Ï´Ù. ¹Ýº¹ÀûÀ¸·Î °è»êÇÏ´Â ´ë½Å °á°ú¸¦ ij½ÃÇؾßÇÕ´Ï´Ù. ¾Ë°í¸®ÁòÀÌ ÃÖÀûȵǾú°Å³ª È¿À²ÀûÀÎ ¾Ë°í¸®ÁòÀÌ ¹ß°ßµÇ¸é ÅëÇյ˴ϴÙ. ³ª¹«¸¦ »ý¼ºÇϱâÀ§ÇÑ ÀÎÅÍÆäÀ̽º´Â ³Ê¹« ¸¹ÀÌ ¹Ù²îÁö ¾Ê¾Æ¾ßÇÕ´Ï´Ù. °á°ú ¿ÀºêÁ§Æ®´Â AI :: MENU object.Synopsis¿¡ ¹ÀÎ Æ®¸® :: nary °´Ã¼°¡ AI :: ¸Þ´º¸¦ »ç¿ëÇÕ´Ï´Ù. MY $ FACTIONS = NEW AI :: MENU :: FACTORY; MY $ MENU = $ FACTIONS-> »ý¼º ($ hash_of_functions); ³» $ menu = $ factory-> »ý¼º ($ hash_of_functions, $ hash_of_categories); ³» $ menu = $ factory-> »ý¼º ($ graph); ´ÙÀ½ ¸Þ¼ÒµåÀÇ methodSall (»ý¼º Á¦¿Ü)ÀÇ methodSallÀº AI :: ¸Þ´º :: factory object.GenerateThis ÇÔ¼ö¸¦ »ý¼ºÇϱâ Àü¿¡ ÀϺΠÇϿ콺 Å°ÇÎÀ» ¼öÇà ÇÒ ¶§ »õ·Î¿î ±â´ÉÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ´ÜÀÏ Çؽà ÂüÁ¶·Î È£Ãâ µÈ Tree.IF¸¦ »ý¼ºÇÏ´Â ¸ðµâÀÌ Çؽô īÅ×°í¸® ¸ñ·ÏÀ» Æ÷ÇÔÇÏ´Â ¹è¿ ÂüÁ¶¿¡ ´ëÇÑ ±â´É ¸ÅÇÎ ¸ñ·ÏÀ̶ó°í °¡Á¤ÇÕ´Ï´Ù. ±â´É À̸§ ¹× ¹üÁÖ À̸§ ¼¼Æ®°¡ ºÐ¸®µÇ¾îÀÖ´Â °ÍÀ¸·Î °¡Á¤ÇÕ´Ï´Ù. ÇØ´ç Àμö°¡ Çؽà ÂüÁ¶ÀÇ Å° ÀÎ °æ¿ì true¸¦ ¹ÝȯÇÏ´Â leaf_q ÇÔ¼ö¿¡ ´ëÇÑ Æó¼â°¡ »ý¼ºµË´Ï´Ù. ¿ÏÀüÇÑ ±×·¡ÇÁ´ÂÀÌ ´ÜÀÏ Çؽà ÂüÁ¶¿¡¼ »ý¼ºµË´Ï´Ù. ¹üÁÖ°¡ ÇÔ¼ö¸¦ ÅëÇØ ´Ù¸¥ ¹üÁÖ¿¡ µµ´Þ ÇÒ ¼öÀÖ´Â °æ¿ì µÎ Ä«Å×°í¸®°£¿¡ °¡ÀåÀÚ¸®°¡ »ðÀԵ˴ϴÙ. ÀÌ °¡ÀåÀÚ¸®´Â ¾ç¹æÇâÀÔ´Ï´Ù. µÎ °³ÀÇ Çؽà ÂüÁ¶¸¦ »ç¿ëÇÏ¿© ù ¹ø° Çؽô ÀÌÀü°ú °°ÀÌ Ã³¸®µÇÁö¸¸ µÎ ¹ø° Çؽà ÂüÁ¶´Â ¹üÁÖ¿¡ ´ëÇÑ ¹üÁÖÀÇ ¸ÅÇÎÀ¸·Î °£Áֵ˴ϴÙ. ÀÌ µÎ ¹ø° Çؽô ù ¹ø° ÇؽÃÀÇ Á¤º¸¸¦ ÀÚµ¿À¸·Î »ý¼ºÇÏ´Â ´ë½Å »ç¿ëµÇ´Â ´ë½Å¿¡ »ç¿ëµÇÁö¸¸ Çؽà ÂüÁ¶°¡ ¾Æ´Ñ ´ÜÀÏ ¿ÀºêÁ§Æ®·Î È£Ãâ µÈ °æ¿ì Àμö´Â ±×·¡ÇÁ °´Ã¼ (ÀϹÝÀûÀ¸·Î ±×·¡ÇÁ :: Áö½Ã)·Î °£Áֵ˴ϴÙ. leaf_q ÇÔ¼ö¸¦ Á¤ÀÇÇؾßÇÕ´Ï´Ù. leaf_qthis ÇÔ¼ö´Â Àμö°¡ ÇÔ¼ö (±×·¡ÇÁÀÇ ÀÙ)¸¦ ³ªÅ¸³»´Â °æ¿ì true¸¦ ¹ÝȯÇÕ´Ï´Ù. Àμö°¡ Ä«Å×°í¸®¸¦ ³ªÅ¸³»´Â °æ¿ì false¸¦ ¹ÝȯÇÕ´Ï´Ù. ÀÌ°ÍÀº AI :: MENU :: FACTIONS °´Ã¼°¡ ÀÛ¼ºµÇ°Å³ª ¸Þ¼Òµå È£ÃâÀ» ÅëÇØ ¼³Á¤ µÉ ¶§ ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. Àμö°¡¾ø´Â ¸Þ¼µå È£ÃâÀº ÇöÀç ÇÔ¼ö¸¦ ¹ÝȯÇÕ´Ï´Ù .MakerThis´Â ±×·¡ÇÁ¿¡¼ ¸Þ´º¸¦ ¸¸µå´Â µ¥ »ç¿ëµÇ´Â ÆÐÅ°ÁöÀÔ´Ï´Ù. ´ÙÀ½ È£ÃâÀÌ ÀÌ·ç¾îÁý´Ï´Ù. MY $ ¸Þ´º = $ self-> {maker} -> new (width => $ self-> {width}, weight_f => $ self-> {weight_f}, reaf_q => $ lefq,) ...¿¡ $ ¸Þ´º -> generate_tree ($ g, $ optscore)¸¦ ¹ÝȯÇÕ´Ï´Ù. $ optscore °ªÀº ÃÖÀûÀÇ Æ®¸®ÀÇ Á¡¼öÀÔ´Ï´Ù. ÀÌ Á¡¼ö°¡ÀÖ´Â Æ®¸®°¡ÀÖ´Â °æ¿ì °Ë»öÀÌ ÁßÁöµÇ¾î¾ßÇÕ´Ï´Ù. AI :: Menu :: Factory °´Ã¼¸¦ ã¾Æ¾ßÇÕ´Ï´Ù. ¼±ÅÃÀû Àμö´Â »ý¼ºÀ» Á¦¿ÜÇÏ°í New.Weight_FThis ÇÔ¼ö¸¦ Á¦¿ÜÇÏ°í´Â Generate ¹× New.weight_fthis ÇÔ¼ö¸¦ »ç¿ëÇÏ´Â µ¥ »ç¿ëµÇ´Â Å° / °ª ½ÖÀÔ´Ï´Ù. ±×·¡ÇÁÀÇ °¡ÀåÀÚ¸® °¡ÁßÄ¡¸¦ °è»êÇÏ´Â µ¥ »ç¿ëµË´Ï´Ù. 4 °³ÀÇ Àμö·Î È£ÃâµË´Ï´Ù : Æ®¸®, ±×·¡ÇÁ °´Ã¼, ¿ø·¡ ¹öÅؽº ÀÎ ´ë»ó Á¤Á¡À» »ý¼ºÇÕ´Ï´Ù. ÀÌ ÇÔ¼ö´Â ¹«ÇÑ ¹«°Ô¿¡ ´ëÇÑ ÇØÁ¦µÇÁö ¾ÊÀº °ÍÀ» ¹ÝȯÇؾßÇÕ´Ï´Ù .Widthis´Â ³ëµå ´ç ¿øÇÏ´Â ¾î¸°ÀÌ ¼öÀÔ´Ï´Ù. ÃÖÀûÀÇ ¹øÈ£ (¹× ±âº»°ª)´Â 3ÀÔ´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ Perl.
AI :: Menu. °ü·Ã ¼ÒÇÁÆ®¿þ¾î