Authors: Svetlana Sodol, Alena Synkova, Robert Desjardins
What is the problem?
Casting actors for a show is a time-consuming task which is error-prone due to the human factor when the cast includes a large number of actors, characters, special circumstances for the assignments and multiple show dates. Since this task is based on logical rules and satisfying multiple constraints, logic programming and Prolog might prove beneficial to serve as a solution to this task. We will build a sample program that a director can use for their theatre troupe when casting and scheduling shows. The original knowledge base will include basic information about the actors and their availability, and an original set of shows currently in the works - with general details on characters, performance dates and special rules to be followed when assignining actors to certain characters on certain dates. The product of the program will be a list for each of the performance dates with the assigned actor for each character role.
What is the something extra?
The basic part of the program will be to assign the actor's characters to the certain dates, such that every role is covered on each performance. However, since in the real world, after a show closes, work for another one starts, the extra part of this program will assist the director on casting for the next show, based on previous castings of the actors. Already having the information on actors and previous castings (with character details) the program will have to learn some things about the actors that will help it assign which characters the actor should play in the next show. We also decided to base the choice on variety of parameters, such as gender, romantic attraction, archetypes the actors are good at, languages they speak, which allows for a more diverse and inclusive casting. The implementation also makes it easy to create other criteria to add into the list to make the casting more precise.
What did we learn from doing this?
We learnt that prolog can be used to build more complicated knowledge and rule bases, and it is pretty flexible when it comes to working with something that requires step-by-step implementation. However, it can also be bothersome when you have a lot of variables to consider as constant parsing create very long and confusing relations. We had to rework some of them to simplify the final result. We also looked at some strategies for debugging in addition to tracing the program: trying out shorter inputs, testing the relations which seemed to be causing the problem individually and going through different cases to help us identify a weird and not intended behaviour.
"Svetlana Sodol, Alena Sinkova, Robert Desjardins, ""Uchunguzi wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti wa Utafiti.""" Kuchagua waigizaji kwa ajili ya show ni kazi ya muda mrefu ambayo ni makosa ya kukabiliwa kutokana na sababu ya binadamu wakati waigizaji ni pamoja na idadi kubwa ya waigizaji, wahusika, hali maalum kwa ajili ya kazi na tarehe nyingi show. Kwa kuwa kazi hii inategemea sheria za mantiki na kuridhisha vizuizi vingi, programu ya mantiki na Prolog inaweza kuthibitika kuwa na faida kutumika kama suluhisho la kazi hii. Tutajenga programu ya mfano ambayo mkurugenzi anaweza kutumia kwa kikundi chake cha ukumbi wa michezo wakati wa kuchagua na kupanga maonyesho. Msingi wa maarifa ya awali utajumuisha habari ya msingi juu ya waigizaji na upatikanaji wao, na seti ya asili ya maonyesho ambayo kwa sasa yanatengenezwa - na maelezo ya jumla juu ya wahusika, tarehe za maonyesho na sheria maalum za kufuata wakati wa kugawa waigizaji kwa wahusika fulani kwa tarehe fulani. Bidhaa ya programu itakuwa orodha kwa kila moja ya tarehe ya utendaji na mwigizaji aliyewekwa kwa kila jukumu la tabia. Ni nini kile kitu cha ziada? Sehemu ya msingi ya programu itakuwa kugawa wahusika wa mwigizaji kwa tarehe fulani, kwa hivyo kila jukumu linafunikwa kwenye kila utendaji. Hata hivyo, kwa kuwa katika ulimwengu halisi, baada ya show kufungwa, kazi kwa ajili ya mwingine kuanza, sehemu ya ziada ya programu hii itasaidia mkurugenzi juu ya casting kwa ajili ya show ijayo, kulingana na castings awali ya waigizaji. Baada ya kuwa na habari juu ya waigizaji na castings ya awali (na maelezo ya tabia) programu itahitaji kujifunza mambo fulani kuhusu waigizaji ambayo itasaidia kugawa wahusika ambao mwigizaji anapaswa kucheza katika show ijayo. """Tuliamua pia kutegemea chaguo kwa vigezo mbalimbali, kama vile jinsia, kivutio cha kimapenzi, archetypes waigizaji ni nzuri katika, lugha wanazozungumza, ambayo inaruhusu casting mbalimbali na pamoja." Utekelezaji pia hufanya iwe rahisi kuunda vigezo vingine vya kuongeza kwenye orodha ili kufanya kutupwa kuwa sahihi zaidi. Tulijifunza nini kutokana na kufanya hivyo? Prolog inaweza kutumika kujenga maarifa zaidi ngumu na msingi wa sheria, na ni rahisi sana wakati wa kufanya kazi na kitu kinachohitaji utekelezaji hatua kwa hatua. Hata hivyo, inaweza pia kuwa annoying wakati una mengi ya vigezo kuzingatia kama mara kwa mara parsing kujenga mahusiano ya muda mrefu sana na kuchanganyikiwa. Ilibidi tufanye marekebisho fulani ili kurahisisha matokeo ya mwisho. Pia tulichunguza baadhi ya mikakati ya debugging pamoja na kufuatilia programu: kujaribu nje pembejeo fupi, kupima mahusiano ambayo walionekana kuwa kusababisha tatizo moja kwa moja na kwenda kwa njia ya kesi tofauti ili kutusaidia kutambua tabia ya ajabu na si lengo.