Исследование работоспособности архитектуры многоагентной системы
В исходных убеждениях агентов ничего менять не будем. Получаем следующий отчет о моделировании: Generator! SIMULATION COMPLETE The sales proceeds of sellerl is 70 The sales proceeds of seller2 is 80 The sales proceeds of seller3 is 100 I finished! Customer!5),[ I select a queue behind custoiner!3). The queue size is 1 [customer!3),[ OK, customer!5), you are behind me… Customer!4),| I select… Читать ещё >
Исследование работоспособности архитектуры многоагентной системы (реферат, курсовая, диплом, контрольная)
Приведем пример испытания построенной модели. Поскольку модель является демонстрационной, то и цель исследования у нас очень простая: установить, смогут ли наши агенты правильно скоординировать свое взаимодействие при разной интенсивности потока заказов. На результаты моделирования будет влиять случайная задержка до появления в фастфуде очередного клиента, время обслуживания клиентов, а также работа механизма доставки сообщений среды Jason.
Пример 8.3.
Ниже представлен пример отчета о моделировании. Каждый отчет представляет собой протокол диалога агентов. В начале каждого предложения в квадратных скобках стоит его автор.
Пример эксперимента
В исходных убеждениях агентов ничего менять не будем. Получаем следующий отчет о моделировании:
[customer (l),] Ilello! Who is last?
[seller 1 ] I HAVE NO QUEUE, customer (l),.
[seller3] I HAVE NO QUEUE, customer (l),.
[seller2] I HAVE NO QUEUE, customer (l),.
[customer (l),] Now I must be served by seller2! My order is 1 [customer (l),] I make a queue to seller2.
[seller2] I’m captured by customer (l),.
[customer (2),] Hello! Who is last?
[sellcrl | I HAVE NO QUEUE, customcr (2),.
[seller3] I HAVE NO QUEUE, customer (2),.
[customer (l),] I last, customer (2),.
[customer (2),] Now I must be served by seller3! My order is 3 [customer (2),] I make a queue to seller3.
[seller3] I’m captured by customer (2),.
[customer (3),] Hello! Who is last?
[seller 1] I HAVE NO QUEUE, customer (3),.
[customer! 1),| I last, customer (3),.
[customer (2), J I last, customer (3),.
[customer (3),] Now I must be served by seller 1! My order is 1 [customer (3),] I make a queue to sellerl.
[seller 1 ] I’m captured by customer (3),.
[customer (4),| Hello! Who is last?
[customer (2),[ I last, customer (4),.
[customer (3),[ I last, customer (4),.
[customer! 1),] I last, customer (4),.
[customer!4),| I select a queue behind customer! l). The queue size is 1 [customer! 1),] OK, customer (4), you are behind me…
[customer!5), j Hello! Who is last?
[customer!2),[ I last, customer!5),.
[customer!3), j I last, customer!5),.
[customer!4),] I last, customer!5),.
[customer!5),[ I select a queue behind custoiner!3). The queue size is 1 [customer!3),[ OK, customer!5), you are behind me…
[customer (6),[ Hello! Who is last?
[customer!?),] I last, customer^),.
[customer!5),] I last, customer (6),.
[customer!4), j I last, customer!6),.
[customer!6),[ I select a queue behind customer (2). The queue size is 1 [customer!?),] OK, customer^), you are behind me…
[customer!?),] Hello! Who is last?
[customer!5),] I last, customer!?),.
[customer^),] I last, customer!?),.
[customer!6),] I last, customer!?),.
[customer!?),] I select a queue behind customer^). The queue size is 2 [customer!6),] OK, customer!?), you are behind me…
[customers),] Hello! Who is last?
[customer!5),] I last, customer!8),.
[customer!4), J I last, customer^),.
[customer!?),] I last, customer!8),.
[customer!8), J I select a queue behind customer^). The queue size is 2 [customer^),] OK, customer^), you are behind me…
[store] There are 5 meals in storage [store] There are 3 meals in storage [customer!!)),] Hello! Who is last?
[customers),] I last, customer (9),.
[customer!5),] I last, customer (9),.
[customer (7),] I last, customcr (9),.
[customer!9),] I select a queue behind customer!5). The queue size is 2 [customer! 10),] Hello! Who is last?
[customer (5),] OK, customer (9), you are behind me…
[customer!8)>] I last, customer! 10),.
[customer!9),] I last, customer! 10),.
[customer!?),] I last, customer! 10),.
[customer (lO),] I select a queue behind customer (7).The queue size is3 [customer!?),] OK, eustomer (lO), you are behind me…
[store] There are 3 meals in storage.
[customer (l),] I got meal from seller2. Who is next?! (customer (4),),.
[customer (4),] Now I must be served by seller2! My order is 3 [seller2] I’m captured by customer (4),.
[customer (l),] I finished!
[customer (2),] I got meal from seller3. Who is next?! (customer (6),),.
[customer (O),] Now I must be served by seller3! My order is 2 [seller3] I’m captured by customer (6),.
[customer (2),] I finished!
[customer (3),[ I got meal from scllerl. Who is next?! (customcr (o),),.
[customer (5),[ Now I must be served by seller 1! My order is 2 [sellerl | I’m captured by customer (5),.
[customer (3),] I finished!
[store] There are 4 meals in storage [store] There are 2 meals in storage [store] There are 0 meals in storage.
[customer (4),] I got meal from seller2. Who is next?! (customer (8),),.
[customer (8),] Now I must be served by seller2! My order is 4 [seller2] I’m captured by customer (8),.
[customer (4),] 1 finished!
[customer (6),] 1 got meal from seller3. Who is next?! (customer (7),),.
[customer (7),] Now I must be served by seller3! My order is 2 [customer (6),| I finished!
[seller3] I’m captured by customer (7),.
[customer (5),| I got meal from sellerl. Who is next?! (customer (9),),.
[customer (9),] Now I must be served by sellerl! My order is 4 [sellerl] I’m captured by customer (9),.
[custoiner (5),] I finished!
[store] There are 1 meals in storage.
[customer (8),| I got meal from seller2. Our queue is empty !!!
[customer (8),| I finished!
[store] There are 3 meals in storage [store] There are 0 meals in storage.
[customer (7),] I got meal from seller3. Who is next?! (customer! 10),),.
[customer! 10),] Now I must be served by seller3! My order is 3 [scllcr3] I’m captured by customer! 10),.
[customer (7)>] I finished!
[customcr (9),| I got meal from sellerl. Our queue is empty !!!
[customer (9),| I finished!
[store] There are 4 meals in storage.
[customer! 10),] I got meal from seller3. Our queue is empty !!!
[generator! SIMULATION COMPLETE [generator] The sales proceeds of sellerl is 70 [generator] The sales proceeds of seller2 is 80 [generator] The sales proceeds of seller3 is 100 [customer! 10),] I finished!
Из отчета видно, что агенты правильно выбирают очередь, размеренно продвигаются в ней и обслуживаются. Когда на складе кончаются продукты, то все ожидают, когда повар приготовит новые. Максимальная очередь образовалась к третьему продавцу, ее размер составил 4.
При повторном моделировании результат, возможно, будет другим. Это можно проверить в указанном пособии[1]. Проведенные эксперименты иллюстрируют три класса наиболее вероятных сценариев развития сюжета и подтверждают работоспособность MAC. Но процесс тестирования MAC обычно проходит долго и очень трудно, поскольку еще не достаточно развит инструментарий отладки и поведение самой MAC трудно предсказуемо от запуска к запуску. Поэтому даже в таком простом примере в дальнейшем можно обнаружить непредвиденные результаты (например, нарушение логики при определенных конфликтах). Однако оставим задачу дальнейших исследований данного примера уважаемому читателю. Это послужит хорошей практикой наблюдения и отладки системы.
- [1] Смирнов С. С., Смольянинова В. Л. Указ. соч.