| ¼öÇÐ :: lp. ¼öÇÐ :: LP´Â ¼±Çü ÇÁ·Î±×·¥ÀÇ OO ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
¼öÇÐ :: lp. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Wim Verhaegen
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~wimv/Math-LP-0.03/lib/Math/LP/Variable.pm
¼öÇÐ :: lp. ű×
¼öÇÐ :: lp. ¼³¸í
¼öÇÐ :: LP´Â ¼±Çü ÇÁ·Î±×·¥¿¡ ´ëÇÑ OO ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. Math :: LP´Â ¼±Çü ÇÁ·Î±×·¥¿¡ ´ëÇÑ OO ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. Synopsis´Â ¼öÇÐ :: LP QW (À¯Çü); # ÃÖÀûÈ À¯Çü °¡Á® ¿À±â Math :: LP :: Constraint QW (À¯Çü); # Á¦¾à Á¶°Ç À¯Çü # »õ·Î¿î LP $ LP = »õ·Î¿î ¼öÇÐ :: LP; # lp $ x1 = new math :: lp :: º¯¼ö (name => x1 ')¿¡ ´ëÇÑ º¯¼ö¸¦ ¸¸µì´Ï´Ù. $ x2 = »õ·Î¿î ¼öÇÐ :: lp :: º¯¼ö (name => 'x2'); # x1 + 2 x2 $ obj_fn = ¼öÇÐ :: LP :: LINEARCOMBINING ($ x1,1.0, $ x2,2.0)À» ¸¸µå´Â °Í; $ lp-> maximize_for ($ obj_fn); # Á¦¾à Á¶°Ç x1 + x2 make math :: lp :: linearCombination ($ x1,1.0, $ x2,1.0), rhs => 2.0, type => $ le,); $ LP-> add_constraint ($ constr); # LP¸¦ ÇØ°áÇÏ°í °á°ú¸¦ ÀμâÇϽʽÿÀ $ LP-> SOLVE () ¶Ç´Â DIE "´Â LP¸¦ ÇØ°áÇÒ ¼ö ¾ø½À´Ï´Ù"; "Optimum =", $ obj_fn -> {value}, "n"À» ÀμâÇϽʽÿÀ. Àμâ "x1 =", $ x1 -> {°ª}, "n"; "x2 =", $ x1 -> {value}, "n"À» ÀμâÇϽʽÿÀ. "Slack =", $ constr -> {flack}, "n"À» ÀμâÇϽʽÿÀ. Math :: LP ÆÐÅ°Áö´Â È¥ÇÕ µÈ ¼±Çü / Á¤¼ö ÇÁ·Î±×·¥À» Á¤ÀÇÇÏ°í ÇØ°áÇÏ´Â °´Ã¼ ÁöÇâ ÀÎÅÍÆäÀ̽º¸¦ Á¦°øÇÕ´Ï´Ù. LP_SOLVE ¶óÀ̺귯¸®¸¦ ±âº» ÇØ°á»ç·Î »ç¿ëÇÕ´Ï´Ù. ÀÌ°ÍÀº µÎ °¡Áö ¹æ¹ýÀÌ ¾Æ´Õ´Ï´Ù. LP´Â Math :: LP¸¦ »ç¿ëÇÏ¿© LP_SOLVE µ¥ÀÌÅÍ ±¸Á¶·Î º¯È¯µÇ°í LP_SOLVE ±â´ÉÀ¸·Î ÇØ°áµÇ¾ú½À´Ï´Ù. LP_SOLVE ±¸Á¶¸¦ ¾î¶»°Ô µç ä¿ì°í Á¶ÀÛ ¹× °Ë»ç¸¦ À§ÇØ ¼öÇÐ :: LP °´Ã¼·Î º¯È¯ ÇÒ ¼ö ¾ø½À´Ï´Ù. Perl¿¡¼ ±×·± Á¾·ùÀÇ ¹°°ÇÀ»ÇÏ°í ½Í´Ù¸é, ¼öÇÐ :: LP :: ÇØ°á ÆÐÅ°Áö¸¦ ´ë½Å »ç¿ëÇϽʽÿÀ.¶ó°í ¸»ÇÏ¸é¼ LP¸¦ ±¸¼ºÇÏ´Â ³í¸®Àû ÀÎ ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù. 1. ¼öÇÐ :: LP :: º¯¼ö ¿ÀºêÁ§Æ®, ±× »çÀÌ¿¡ Á¤¼ö Variables2. ¼öÇÐ :: LP :: LINEARCOMBINING °´Ã¼¸¦ º¯¼ö·Î ±¸ÃàÇÏ°í ¸ñÇ¥ ÇÔ¼ö ¹× Á¦¾à Á¶°ÇÀ¸·Î »ç¿ëÇÕ´Ï´Ù. LP4¸¦ ÇØ°áÇϽʽÿÀ. ¼öÇÐ :: LP :: º¯¼ö ¿ÀºêÁ§Æ®, ¼öÇÐ :: LP :: Á¦¾à Á¶°Ç °³Ã¼ÀÇ ½½·¢ ¹× ÀÌÁß °ª¿¡¼ º¯¼ö °ªÀ» °¡Á®¿É´Ï´Ù. ¹× ÇØ´ç ¼öÇÐ :: LP :: LinearCombination.Requirements¿¡¼ Çà °ª (ÃÖÀû Æ÷ÇÔ) (ÃÖÀû Æ÷ÇÔ) : ¡¤ Perl ¿ä±¸ »çÇ× : ¡¤ Perl.
¼öÇÐ :: lp. °ü·Ã ¼ÒÇÁÆ®¿þ¾î