extensions [cf] breed [comments comment] breed [authors author] comments-own [ intent ;; Буква (эмоция) referenceObject ;; Референциальный объект (1..4) content ;; Контент (правила будут позже) author_id ;; Автор is_root ;; Флаг: 1 у корневой вершины (статья), 0 у остальных ] globals [ comment_generation_probability branch_author_comments_count_probability branch_author_comments_location_probability ways neededwayid cur_way all_pairs all_pairs_frex branches_count comments_count_in_branches_M comments_count_in_branches_D authors_comments_generation authors_comments_frex_rules_generation current_author_comments_frex_rules_generation authors_comments_location_rules_generation authors_comments_generation_log ] to setup clear-all create-authors count_of_authors [ hide-turtle ] create-comments 1 [ setxy random-xcor random-ycor set size 1.5 set author_id random count_of_authors + 1 set intent 0 set referenceObject 0 set is_root 1 set color green set shape "triangle" set label word "root_" author_id ] set authors_comments_generation n-values count_of_authors [0] set authors_comments_frex_rules_generation n-values count_of_authors [ n-values 4 [0] ] set authors_comments_location_rules_generation n-values count_of_authors [ n-values 5 [0] ] set authors_comments_generation_log n-values count_of_authors [ [] ] reset-ticks end to go ask authors [ read_parameters_from_file who generate-comment who ;show comment_generation_probability ;show branch_author_comments_count_probability ;show branch_author_comments_location_probability ] ;ask authors [ ; generate-comment who ;] ask comments with [ is_root = 0 ] [ set label word "№" word who word ": " word author_id word "; " word intent word "_" word referenceObject word "_" content ] layout-radial turtles links (max-one-of comments [count my-in-links]) set all_pairs [] set all_pairs_frex [] ask [in-link-neighbors] of comment min [who] of comments [ find-all-pairs who -1 ] ;print all_pairs ;print all_pairs_frex set cur_way [] set ways [] find-all-ways min [who] of comments update-statistics tick if (ticks mod log_creation_tick = 0) [ write-to-file-current-log-authors-statistics set authors_comments_generation n-values count_of_authors [0] set authors_comments_frex_rules_generation n-values count_of_authors [ n-values 4 [0] ] set authors_comments_location_rules_generation n-values count_of_authors [ n-values 5 [0] ] set authors_comments_generation_log n-values count_of_authors [ [] ] ] end to generate-comment [ auth_id ] let current_author_comments_generation_log item auth_id authors_comments_generation_log set cur_way [] set ways [] find-all-ways min [who] of comments choose-needed-way auth_id ;print neededwayid if (neededwayid > -1) [ ;; Проверяем, генерировать ли комментарий в текущем такте if (random 100 < comment_generation_probability) [ ;; Если ГЕНЕРИРУЕМ, обновляем статистику по количеству сгенерированных комментариев set authors_comments_generation replace-item auth_id authors_comments_generation (item auth_id authors_comments_generation + 1) set authors_comments_frex_rules_generation replace-item auth_id authors_comments_frex_rules_generation current_author_comments_frex_rules_generation ;show authors_comments_frex_rules_generation ;; ГЕНЕРИРУЕМ let tempwayid 0 let tmp_of_author_location_in_branches_frex (n-values 5 [0]) let list_of_possible_ids (n-values 5 [[]]) let cur_list_of_possible_ids_elem [] foreach (item neededwayid ways) [ x -> ifelse (tempwayid = 0 and ([author_id] of x != auth_id)) [ set tmp_of_author_location_in_branches_frex replace-item 0 tmp_of_author_location_in_branches_frex (item 0 tmp_of_author_location_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 0 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 0 list_of_possible_ids cur_list_of_possible_ids_elem ] [ ifelse (tempwayid = ((length (item neededwayid ways)) - 1) and ([author_id] of x != auth_id)) [ set tmp_of_author_location_in_branches_frex replace-item 4 tmp_of_author_location_in_branches_frex (item 4 tmp_of_author_location_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 4 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 4 list_of_possible_ids cur_list_of_possible_ids_elem ] [ ifelse ((tempwayid / (length (item neededwayid ways))) < ((length (item neededwayid ways)) * (branch_author_comments_location_limit / 100)) and ([author_id] of x != auth_id)) [ set tmp_of_author_location_in_branches_frex replace-item 1 tmp_of_author_location_in_branches_frex (item 1 tmp_of_author_location_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 1 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 1 list_of_possible_ids cur_list_of_possible_ids_elem ] [ ifelse ((tempwayid / (length (item neededwayid ways))) < ((length (item neededwayid ways)) * ((100 - branch_author_comments_location_limit) / 100)) and ([author_id] of x != auth_id)) [ set tmp_of_author_location_in_branches_frex replace-item 2 tmp_of_author_location_in_branches_frex (item 2 tmp_of_author_location_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 2 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 2 list_of_possible_ids cur_list_of_possible_ids_elem ] [ set tmp_of_author_location_in_branches_frex replace-item 3 tmp_of_author_location_in_branches_frex (item 3 tmp_of_author_location_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 3 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 3 list_of_possible_ids cur_list_of_possible_ids_elem ] ] ] ] set tempwayid tempwayid + 1 ] set tempwayid 0 let tmp_of_author_location_in_branches_frex_enum [0 1 2 3 4] foreach tmp_of_author_location_in_branches_frex [ x -> if (x = 0) [ set tmp_of_author_location_in_branches_frex_enum replace-item tempwayid tmp_of_author_location_in_branches_frex_enum [] set list_of_possible_ids replace-item tempwayid list_of_possible_ids [] ] set tempwayid tempwayid + 1 ] set tmp_of_author_location_in_branches_frex_enum remove [] tmp_of_author_location_in_branches_frex_enum set list_of_possible_ids remove [] list_of_possible_ids let tmp_of_author_location_in_branches [] foreach tmp_of_author_location_in_branches_frex_enum [ x -> set tmp_of_author_location_in_branches sentence tmp_of_author_location_in_branches (item x branch_author_comments_location_probability) ] let cur_sum 0 set tempwayid 0 let neededcomment -1 let rand_val random sum tmp_of_author_location_in_branches foreach tmp_of_author_location_in_branches [ x -> set cur_sum cur_sum + x if (rand_val >= cur_sum - x and rand_val < cur_sum) [ set neededcomment tempwayid ] set tempwayid tempwayid + 1 ] if (neededcomment > -1) [ set neededcomment one-of (item neededcomment list_of_possible_ids) ask (item neededcomment (item neededwayid ways)) [ hatch-comments 1 ;; Обновляем статистику авторских комментариев по глубине update-authors_comments_location_rules_generation auth_id position self (item neededwayid ways) (length (item neededwayid ways)) ask comments with-max [who] [ set is_root 0 set shape "circle" setxy random-xcor random-ycor set size 1.5 let intent_referent calculate_intent word [intent] of myself [referenceObject] of myself set intent read-from-string substring intent_referent 0 (length intent_referent - 1) set referenceObject read-from-string last intent_referent ifelse (random 2 > 0) [set content 1] [set content 2] ;; Обновляем лог комментариев текущего автора set current_author_comments_generation_log lput (word [intent] of myself word [referenceObject] of myself word ";" word intent referenceObject) current_author_comments_generation_log set authors_comments_generation_log replace-item auth_id authors_comments_generation_log current_author_comments_generation_log create-link-to myself set author_id auth_id set color author_id * 10 + 5 ] ] ;show authors_comments_generation_log ] ] ] end to-report calculate_intent [ base_intent ] if (base_intent = "13") [ ;; а3 let rand_val random 1065 if (rand_val >= 0 and rand_val < 103) [ report "13" ] ;; а3 if (rand_val >= 103 and rand_val < 159) [ report "23" ] ;; б3 if (rand_val >= 159 and rand_val < 199) [ report "43" ] ;; г3 if (rand_val >= 199 and rand_val < 274) [ report "61" ] ;; е1 if (rand_val >= 274 and rand_val < 345) [ report "73" ] ;; ж3 if (rand_val >= 345 and rand_val < 387) [ report "74" ] ;; ж4 if (rand_val >= 387 and rand_val < 424) [ report "93" ] ;; и3 if (rand_val >= 424 and rand_val < 516) [ report "94" ] ;; и4 if (rand_val >= 516 and rand_val < 575) [ report "113" ] ;; л3 if (rand_val >= 575 and rand_val < 629) [ report "133" ] ;; н3 if (rand_val >= 629 and rand_val < 656) [ report "134" ] ;; н4 if (rand_val >= 656 and rand_val < 711) [ report "153" ] ;; п3 if (rand_val >= 711 and rand_val < 768) [ report "163" ] ;; р3 if (rand_val >= 768 and rand_val < 793) [ report "173" ] ;; с3 if (rand_val >= 793 and rand_val < 824) [ report "183" ] ;; т3 if (rand_val >= 824 and rand_val < 850) [ report "184" ] ;; т4 if (rand_val >= 850 and rand_val < 892) [ report "203" ] ;; ф3 if (rand_val >= 892 and rand_val < 940) [ report "223" ] ;; ц3 if (rand_val >= 940 and rand_val < 978) [ report "233" ] ;; ч3 if (rand_val >= 978 and rand_val < 1006) [ report "234" ] ;; ч4 if (rand_val >= 1006 and rand_val < 1040) [ report "243" ] ;; ш3 if (rand_val >= 1040 and rand_val < 1065) [ report "254" ] ;; щ4 ] if (base_intent = "23") [ ;; б3 let rand_val random 849 if (rand_val >= 0 and rand_val < 65) [ report "13" ] ;; а3 if (rand_val >= 65 and rand_val < 133) [ report "23" ] ;; б3 if (rand_val >= 133 and rand_val < 159) [ report "33" ] ;; в3 if (rand_val >= 159 and rand_val < 187) [ report "43" ] ;; г3 if (rand_val >= 187 and rand_val < 239) [ report "61" ] ;; е1 if (rand_val >= 239 and rand_val < 287) [ report "73" ] ;; ж3 if (rand_val >= 287 and rand_val < 333) [ report "74" ] ;; ж4 if (rand_val >= 333 and rand_val < 359) [ report "93" ] ;; и3 if (rand_val >= 359 and rand_val < 433) [ report "94" ] ;; и4 if (rand_val >= 433 and rand_val < 468) [ report "113" ] ;; л3 if (rand_val >= 468 and rand_val < 514) [ report "133" ] ;; н3 if (rand_val >= 514 and rand_val < 563) [ report "153" ] ;; п3 if (rand_val >= 563 and rand_val < 599) [ report "163" ] ;; р3 if (rand_val >= 599 and rand_val < 629) [ report "183" ] ;; т3 if (rand_val >= 629 and rand_val < 659) [ report "184" ] ;; т4 if (rand_val >= 659 and rand_val < 704) [ report "223" ] ;; ц3 if (rand_val >= 704 and rand_val < 754) [ report "233" ] ;; ч3 if (rand_val >= 754 and rand_val < 784) [ report "234" ] ;; ч4 if (rand_val >= 784 and rand_val < 822) [ report "243" ] ;; ш3 if (rand_val >= 822 and rand_val < 849) [ report "254" ] ;; щ4 ] if (base_intent = "33") [ ;; в3 ] if (base_intent = "43") [ ;; г3 let rand_val random 353 if (rand_val >= 0 and rand_val < 31) [ report "13" ] ;; а3 if (rand_val >= 31 and rand_val < 55) [ report "23" ] ;; б3 if (rand_val >= 55 and rand_val < 83) [ report "43" ] ;; г3 if (rand_val >= 83 and rand_val < 110) [ report "61" ] ;; е1 if (rand_val >= 110 and rand_val < 136) [ report "94" ] ;; и4 if (rand_val >= 136 and rand_val < 186) [ report "113" ] ;; л3 if (rand_val >= 186 and rand_val < 237) [ report "133" ] ;; н3 if (rand_val >= 237 and rand_val < 266) [ report "153" ] ;; п3 if (rand_val >= 266 and rand_val < 293) [ report "183" ] ;; т3 if (rand_val >= 293 and rand_val < 317) [ report "203" ] ;; ф3 if (rand_val >= 317 and rand_val < 353) [ report "223" ] ;; ц3 ] if (base_intent = "61") [ ;; е1 let rand_val random 917 if (rand_val >= 0 and rand_val < 88) [ report "13" ] ;; а3 if (rand_val >= 88 and rand_val < 140) [ report "23" ] ;; б3 if (rand_val >= 140 and rand_val < 172) [ report "33" ] ;; в3 if (rand_val >= 172 and rand_val < 205) [ report "43" ] ;; г3 if (rand_val >= 205 and rand_val < 281) [ report "61" ] ;; е1 if (rand_val >= 281 and rand_val < 349) [ report "73" ] ;; ж3 if (rand_val >= 349 and rand_val < 383) [ report "74" ] ;; ж4 if (rand_val >= 383 and rand_val < 416) [ report "93" ] ;; и3 if (rand_val >= 416 and rand_val < 478) [ report "94" ] ;; и4 if (rand_val >= 478 and rand_val < 527) [ report "113" ] ;; л3 if (rand_val >= 527 and rand_val < 603) [ report "133" ] ;; н3 if (rand_val >= 603 and rand_val < 655) [ report "153" ] ;; п3 if (rand_val >= 655 and rand_val < 698) [ report "163" ] ;; р3 if (rand_val >= 698 and rand_val < 733) [ report "183" ] ;; т3 if (rand_val >= 733 and rand_val < 797) [ report "223" ] ;; ц3 if (rand_val >= 797 and rand_val < 848) [ report "233" ] ;; ч3 if (rand_val >= 848 and rand_val < 875) [ report "234" ] ;; ч4 if (rand_val >= 875 and rand_val < 917) [ report "243" ] ;; ш3 ] if (base_intent = "73") [ ;; ж3 let rand_val random 660 if (rand_val >= 0 and rand_val < 68) [ report "13" ] ;; а3 if (rand_val >= 68 and rand_val < 110) [ report "23" ] ;; б3 if (rand_val >= 110 and rand_val < 134) [ report "33" ] ;; в3 if (rand_val >= 134 and rand_val < 179) [ report "61" ] ;; е1 if (rand_val >= 179 and rand_val < 264) [ report "73" ] ;; ж3 if (rand_val >= 264 and rand_val < 300) [ report "74" ] ;; ж4 if (rand_val >= 300 and rand_val < 333) [ report "93" ] ;; и3 if (rand_val >= 333 and rand_val < 370) [ report "94" ] ;; и4 if (rand_val >= 370 and rand_val < 407) [ report "113" ] ;; л3 if (rand_val >= 407 and rand_val < 456) [ report "133" ] ;; н3 if (rand_val >= 456 and rand_val < 495) [ report "153" ] ;; п3 if (rand_val >= 495 and rand_val < 527) [ report "163" ] ;; р3 if (rand_val >= 527 and rand_val < 553) [ report "203" ] ;; ф3 if (rand_val >= 553 and rand_val < 602) [ report "223" ] ;; ц3 if (rand_val >= 602 and rand_val < 632) [ report "233" ] ;; ч3 if (rand_val >= 632 and rand_val < 660) [ report "234" ] ;; ч4 ] if (base_intent = "74") [ ;; ж4 let rand_val random 470 if (rand_val >= 0 and rand_val < 46) [ report "13" ] ;; а3 if (rand_val >= 46 and rand_val < 91) [ report "23" ] ;; б3 if (rand_val >= 91 and rand_val < 126) [ report "61" ] ;; е1 if (rand_val >= 126 and rand_val < 171) [ report "73" ] ;; ж3 if (rand_val >= 171 and rand_val < 214) [ report "74" ] ;; ж4 if (rand_val >= 214 and rand_val < 247) [ report "93" ] ;; и3 if (rand_val >= 247 and rand_val < 304) [ report "94" ] ;; и4 if (rand_val >= 304 and rand_val < 333) [ report "113" ] ;; л3 if (rand_val >= 333 and rand_val < 358) [ report "133" ] ;; н3 if (rand_val >= 358 and rand_val < 386) [ report "153" ] ;; п3 if (rand_val >= 386 and rand_val < 420) [ report "223" ] ;; ц3 if (rand_val >= 420 and rand_val < 446) [ report "233" ] ;; ч3 if (rand_val >= 446 and rand_val < 470) [ report "234" ] ;; ч4 ] if (base_intent = "93") [ ;; и3 let rand_val random 93 if (rand_val >= 0 and rand_val < 34) [ report "13" ] ;; а3 if (rand_val >= 34 and rand_val < 68) [ report "73" ] ;; ж3 if (rand_val >= 68 and rand_val < 93) [ report "94" ] ;; и4 ] if (base_intent = "94") [ ;; и4 let rand_val random 1331 if (rand_val >= 0 and rand_val < 113) [ report "13" ] ;; а3 if (rand_val >= 113 and rand_val < 210) [ report "23" ] ;; б3 if (rand_val >= 210 and rand_val < 255) [ report "33" ] ;; в3 if (rand_val >= 255 and rand_val < 282) [ report "43" ] ;; г3 if (rand_val >= 282 and rand_val < 329) [ report "61" ] ;; е1 if (rand_val >= 329 and rand_val < 391) [ report "73" ] ;; ж3 if (rand_val >= 391 and rand_val < 450) [ report "74" ] ;; ж4 if (rand_val >= 450 and rand_val < 478) [ report "93" ] ;; и3 if (rand_val >= 478 and rand_val < 617) [ report "94" ] ;; и4 if (rand_val >= 617 and rand_val < 653) [ report "113" ] ;; л3 if (rand_val >= 653 and rand_val < 712) [ report "133" ] ;; н3 if (rand_val >= 712 and rand_val < 745) [ report "134" ] ;; н4 if (rand_val >= 745 and rand_val < 799) [ report "153" ] ;; п3 if (rand_val >= 799 and rand_val < 836) [ report "154" ] ;; п4 if (rand_val >= 836 and rand_val < 883) [ report "163" ] ;; р3 if (rand_val >= 883 and rand_val < 910) [ report "173" ] ;; с3 if (rand_val >= 910 and rand_val < 941) [ report "183" ] ;; т3 if (rand_val >= 941 and rand_val < 979) [ report "184" ] ;; т4 if (rand_val >= 979 and rand_val < 1014) [ report "203" ] ;; ф3 if (rand_val >= 1014 and rand_val < 1065) [ report "223" ] ;; ц3 if (rand_val >= 1065 and rand_val < 1127) [ report "233" ] ;; ч3 if (rand_val >= 1127 and rand_val < 1185) [ report "234" ] ;; ч4 if (rand_val >= 1185 and rand_val < 1242) [ report "243" ] ;; ш3 if (rand_val >= 1242 and rand_val < 1282) [ report "244" ] ;; ш4 if (rand_val >= 1282 and rand_val < 1331) [ report "254" ] ;; щ4 ] if (base_intent = "113") [ ;; л3 let rand_val random 976 if (rand_val >= 0 and rand_val < 70) [ report "13" ] ;; а3 if (rand_val >= 70 and rand_val < 116) [ report "23" ] ;; б3 if (rand_val >= 116 and rand_val < 174) [ report "43" ] ;; г3 if (rand_val >= 174 and rand_val < 232) [ report "61" ] ;; е1 if (rand_val >= 232 and rand_val < 279) [ report "73" ] ;; ж3 if (rand_val >= 279 and rand_val < 306) [ report "93" ] ;; и3 if (rand_val >= 306 and rand_val < 342) [ report "94" ] ;; и4 if (rand_val >= 342 and rand_val < 490) [ report "113" ] ;; л3 if (rand_val >= 490 and rand_val < 579) [ report "133" ] ;; н3 if (rand_val >= 579 and rand_val < 620) [ report "153" ] ;; п3 if (rand_val >= 620 and rand_val < 649) [ report "163" ] ;; р3 if (rand_val >= 649 and rand_val < 680) [ report "173" ] ;; с3 if (rand_val >= 680 and rand_val < 717) [ report "183" ] ;; т3 if (rand_val >= 717 and rand_val < 745) [ report "184" ] ;; т4 if (rand_val >= 745 and rand_val < 789) [ report "203" ] ;; ф3 if (rand_val >= 789 and rand_val < 867) [ report "223" ] ;; ц3 if (rand_val >= 867 and rand_val < 902) [ report "233" ] ;; ч3 if (rand_val >= 902 and rand_val < 947) [ report "243" ] ;; ш3 if (rand_val >= 947 and rand_val < 976) [ report "253" ] ;; щ3 ] if (base_intent = "114") [ ;; л4 let rand_val random 96 if (rand_val >= 0 and rand_val < 31) [ report "13" ] ;; а3 if (rand_val >= 31 and rand_val < 68) [ report "113" ] ;; л3 if (rand_val >= 68 and rand_val < 96) [ report "133" ] ;; н3 ] if (base_intent = "133") [ ;; н3 let rand_val random 803 if (rand_val >= 0 and rand_val < 54) [ report "13" ] ;; а3 if (rand_val >= 54 and rand_val < 93) [ report "23" ] ;; б3 if (rand_val >= 93 and rand_val < 131) [ report "43" ] ;; г3 if (rand_val >= 131 and rand_val < 188) [ report "61" ] ;; е1 if (rand_val >= 188 and rand_val < 231) [ report "73" ] ;; ж3 if (rand_val >= 231 and rand_val < 280) [ report "94" ] ;; и4 if (rand_val >= 280 and rand_val < 358) [ report "113" ] ;; л3 if (rand_val >= 358 and rand_val < 455) [ report "133" ] ;; н3 if (rand_val >= 455 and rand_val < 490) [ report "153" ] ;; п3 if (rand_val >= 490 and rand_val < 529) [ report "163" ] ;; р3 if (rand_val >= 529 and rand_val < 554) [ report "173" ] ;; с3 if (rand_val >= 554 and rand_val < 580) [ report "183" ] ;; т3 if (rand_val >= 580 and rand_val < 625) [ report "203" ] ;; ф3 if (rand_val >= 625 and rand_val < 701) [ report "223" ] ;; ц3 if (rand_val >= 701 and rand_val < 734) [ report "233" ] ;; ч3 if (rand_val >= 734 and rand_val < 777) [ report "243" ] ;; ш3 if (rand_val >= 777 and rand_val < 803) [ report "253" ] ;; щ3 ] if (base_intent = "134") [ ;; н4 let rand_val random 39 if (rand_val >= 0 and rand_val < 39) [ report "94" ] ;; и4 ] if (base_intent = "153") [ ;; п3 let rand_val random 426 if (rand_val >= 0 and rand_val < 45) [ report "13" ] ;; а3 if (rand_val >= 45 and rand_val < 82) [ report "23" ] ;; б3 if (rand_val >= 82 and rand_val < 112) [ report "61" ] ;; е1 if (rand_val >= 112 and rand_val < 149) [ report "73" ] ;; ж3 if (rand_val >= 149 and rand_val < 200) [ report "94" ] ;; и4 if (rand_val >= 200 and rand_val < 229) [ report "113" ] ;; л3 if (rand_val >= 229 and rand_val < 267) [ report "133" ] ;; н3 if (rand_val >= 267 and rand_val < 303) [ report "153" ] ;; п3 if (rand_val >= 303 and rand_val < 329) [ report "203" ] ;; ф3 if (rand_val >= 329 and rand_val < 361) [ report "223" ] ;; ц3 if (rand_val >= 361 and rand_val < 394) [ report "233" ] ;; ч3 if (rand_val >= 394 and rand_val < 426) [ report "243" ] ;; ш3 ] if (base_intent = "154") [ ;; п4 let rand_val random 25 if (rand_val >= 0 and rand_val < 25) [ report "94" ] ;; и4 ] if (base_intent = "163") [ ;; р3 let rand_val random 525 if (rand_val >= 0 and rand_val < 57) [ report "13" ] ;; а3 if (rand_val >= 57 and rand_val < 92) [ report "23" ] ;; б3 if (rand_val >= 92 and rand_val < 119) [ report "43" ] ;; г3 if (rand_val >= 119 and rand_val < 162) [ report "61" ] ;; е1 if (rand_val >= 162 and rand_val < 204) [ report "73" ] ;; ж3 if (rand_val >= 204 and rand_val < 228) [ report "93" ] ;; и3 if (rand_val >= 228 and rand_val < 277) [ report "94" ] ;; и4 if (rand_val >= 277 and rand_val < 310) [ report "113" ] ;; л3 if (rand_val >= 310 and rand_val < 360) [ report "133" ] ;; н3 if (rand_val >= 360 and rand_val < 391) [ report "153" ] ;; п3 if (rand_val >= 391 and rand_val < 428) [ report "163" ] ;; р3 if (rand_val >= 428 and rand_val < 460) [ report "203" ] ;; ф3 if (rand_val >= 460 and rand_val < 499) [ report "223" ] ;; ц3 if (rand_val >= 499 and rand_val < 525) [ report "233" ] ;; ч3 ] if (base_intent = "173") [ ;; с3 let rand_val random 336 if (rand_val >= 0 and rand_val < 41) [ report "13" ] ;; а3 if (rand_val >= 41 and rand_val < 69) [ report "23" ] ;; б3 if (rand_val >= 69 and rand_val < 94) [ report "61" ] ;; е1 if (rand_val >= 94 and rand_val < 125) [ report "94" ] ;; и4 if (rand_val >= 125 and rand_val < 183) [ report "113" ] ;; л3 if (rand_val >= 183 and rand_val < 222) [ report "133" ] ;; н3 if (rand_val >= 222 and rand_val < 252) [ report "173" ] ;; с3 if (rand_val >= 252 and rand_val < 282) [ report "203" ] ;; ф3 if (rand_val >= 282 and rand_val < 312) [ report "223" ] ;; ц3 if (rand_val >= 312 and rand_val < 336) [ report "243" ] ;; ш3 ] if (base_intent = "183") [ ;; т3 let rand_val random 198 if (rand_val >= 0 and rand_val < 33) [ report "13" ] ;; а3 if (rand_val >= 33 and rand_val < 70) [ report "94" ] ;; и4 if (rand_val >= 70 and rand_val < 111) [ report "113" ] ;; л3 if (rand_val >= 111 and rand_val < 143) [ report "133" ] ;; н3 if (rand_val >= 143 and rand_val < 168) [ report "153" ] ;; п3 if (rand_val >= 168 and rand_val < 198) [ report "223" ] ;; ц3 ] if (base_intent = "184") [ ;; т4 let rand_val random 279 if (rand_val >= 0 and rand_val < 36) [ report "13" ] ;; а3 if (rand_val >= 36 and rand_val < 66) [ report "23" ] ;; б3 if (rand_val >= 66 and rand_val < 91) [ report "73" ] ;; ж3 if (rand_val >= 91 and rand_val < 138) [ report "94" ] ;; и4 if (rand_val >= 138 and rand_val < 166) [ report "113" ] ;; л3 if (rand_val >= 166 and rand_val < 193) [ report "133" ] ;; н3 if (rand_val >= 193 and rand_val < 219) [ report "203" ] ;; ф3 if (rand_val >= 219 and rand_val < 253) [ report "223" ] ;; ц3 if (rand_val >= 253 and rand_val < 279) [ report "233" ] ;; ч3 ] if (base_intent = "203") [ ;; ф3 let rand_val random 546 if (rand_val >= 0 and rand_val < 43) [ report "13" ] ;; а3 if (rand_val >= 43 and rand_val < 76) [ report "23" ] ;; б3 if (rand_val >= 76 and rand_val < 106) [ report "61" ] ;; е1 if (rand_val >= 106 and rand_val < 146) [ report "73" ] ;; ж3 if (rand_val >= 146 and rand_val < 171) [ report "74" ] ;; ж4 if (rand_val >= 171 and rand_val < 205) [ report "94" ] ;; и4 if (rand_val >= 205 and rand_val < 253) [ report "113" ] ;; л3 if (rand_val >= 253 and rand_val < 314) [ report "133" ] ;; н3 if (rand_val >= 314 and rand_val < 341) [ report "153" ] ;; п3 if (rand_val >= 341 and rand_val < 372) [ report "163" ] ;; р3 if (rand_val >= 372 and rand_val < 400) [ report "183" ] ;; т3 if (rand_val >= 400 and rand_val < 437) [ report "203" ] ;; ф3 if (rand_val >= 437 and rand_val < 478) [ report "223" ] ;; ц3 if (rand_val >= 478 and rand_val < 513) [ report "233" ] ;; ч3 if (rand_val >= 513 and rand_val < 546) [ report "243" ] ;; ш3 ] if (base_intent = "223") [ ;; ц3 let rand_val random 443 if (rand_val >= 0 and rand_val < 46) [ report "13" ] ;; а3 if (rand_val >= 46 and rand_val < 71) [ report "23" ] ;; б3 if (rand_val >= 71 and rand_val < 104) [ report "61" ] ;; е1 if (rand_val >= 104 and rand_val < 141) [ report "73" ] ;; ж3 if (rand_val >= 141 and rand_val < 169) [ report "94" ] ;; и4 if (rand_val >= 169 and rand_val < 216) [ report "113" ] ;; л3 if (rand_val >= 216 and rand_val < 265) [ report "133" ] ;; н3 if (rand_val >= 265 and rand_val < 294) [ report "153" ] ;; п3 if (rand_val >= 294 and rand_val < 324) [ report "163" ] ;; р3 if (rand_val >= 324 and rand_val < 353) [ report "203" ] ;; ф3 if (rand_val >= 353 and rand_val < 416) [ report "223" ] ;; ц3 if (rand_val >= 416 and rand_val < 443) [ report "243" ] ;; ш3 ] if (base_intent = "233") [ ;; ч3 let rand_val random 439 if (rand_val >= 0 and rand_val < 44) [ report "13" ] ;; а3 if (rand_val >= 44 and rand_val < 74) [ report "23" ] ;; б3 if (rand_val >= 74 and rand_val < 103) [ report "43" ] ;; г3 if (rand_val >= 103 and rand_val < 135) [ report "61" ] ;; е1 if (rand_val >= 135 and rand_val < 167) [ report "73" ] ;; ж3 if (rand_val >= 167 and rand_val < 210) [ report "94" ] ;; и4 if (rand_val >= 210 and rand_val < 243) [ report "113" ] ;; л3 if (rand_val >= 243 and rand_val < 282) [ report "133" ] ;; н3 if (rand_val >= 282 and rand_val < 310) [ report "153" ] ;; п3 if (rand_val >= 310 and rand_val < 342) [ report "203" ] ;; ф3 if (rand_val >= 342 and rand_val < 367) [ report "223" ] ;; ц3 if (rand_val >= 367 and rand_val < 407) [ report "233" ] ;; ч3 if (rand_val >= 407 and rand_val < 439) [ report "234" ] ;; ч4 ] if (base_intent = "234") [ ;; ч4 let rand_val random 360 if (rand_val >= 0 and rand_val < 45) [ report "13" ] ;; а3 if (rand_val >= 45 and rand_val < 90) [ report "23" ] ;; б3 if (rand_val >= 90 and rand_val < 114) [ report "73" ] ;; ж3 if (rand_val >= 114 and rand_val < 139) [ report "74" ] ;; ж4 if (rand_val >= 139 and rand_val < 198) [ report "94" ] ;; и4 if (rand_val >= 198 and rand_val < 227) [ report "133" ] ;; н3 if (rand_val >= 227 and rand_val < 263) [ report "153" ] ;; п3 if (rand_val >= 263 and rand_val < 288) [ report "223" ] ;; ц3 if (rand_val >= 288 and rand_val < 327) [ report "233" ] ;; ч3 if (rand_val >= 327 and rand_val < 360) [ report "234" ] ;; ч4 ] if (base_intent = "243") [ ;; ш3 let rand_val random 199 if (rand_val >= 0 and rand_val < 35) [ report "13" ] ;; а3 if (rand_val >= 35 and rand_val < 73) [ report "94" ] ;; и4 if (rand_val >= 73 and rand_val < 99) [ report "113" ] ;; л3 if (rand_val >= 99 and rand_val < 126) [ report "153" ] ;; п3 if (rand_val >= 126 and rand_val < 158) [ report "223" ] ;; ц3 if (rand_val >= 158 and rand_val < 199) [ report "243" ] ;; ш3 ] if (base_intent = "244") [ ;; ш4 let rand_val random 24 if (rand_val >= 0 and rand_val < 24) [ report "94" ] ;; и4 ] if (base_intent = "244") [ ;; ш4 let rand_val random 64 if (rand_val >= 73 and rand_val < 30) [ report "113" ] ;; л3 if (rand_val >= 30 and rand_val < 64) [ report "133" ] ;; н3 ] if (base_intent = "254") [ ;; щ4 let rand_val random 117 if (rand_val >= 0 and rand_val < 33) [ report "13" ] ;; а3 if (rand_val >= 33 and rand_val < 62) [ report "23" ] ;; б3 if (rand_val >= 62 and rand_val < 93) [ report "94" ] ;; и4 if (rand_val >= 93 and rand_val < 117) [ report "153" ] ;; п3 ] report word (random 25 + 1) (random 4 + 1) end to find-all-ways [ cur_comment ] let cur_way1 (n-values (length cur_way + 1) [0]) let cur_id 0 foreach cur_way [ set cur_way1 replace-item cur_id cur_way1 item cur_id cur_way set cur_id cur_id + 1 ] set cur_way1 replace-item cur_id cur_way1 comment cur_comment set cur_way cur_way1 ifelse (count [in-link-neighbors] of comment cur_comment > 0) [ ask [in-link-neighbors] of comment cur_comment [ find-all-ways who ] set cur_way remove-item (length cur_way - 1) cur_way ] [ ;print cur_way let tempways (n-values (length ways + 1) [0]) set cur_id 0 foreach ways [ set tempways replace-item cur_id tempways item cur_id ways set cur_id cur_id + 1 ] set tempways replace-item cur_id tempways cur_way set ways tempways ;print ways set cur_way remove-item (length cur_way - 1) cur_way ] end to choose-needed-way [ auth_id ] let tempwaylength 0 let tempwayid 0 let list_of_author_frequency_in_branches (n-values (length ways) [0]) foreach ways[ currentway -> foreach currentway [ cw -> if ([author_id] of cw = auth_id) [ set tempwaylength tempwaylength + 1 ] ] set list_of_author_frequency_in_branches replace-item tempwayid list_of_author_frequency_in_branches tempwaylength set tempwayid tempwayid + 1 set tempwaylength 0 ] set tempwayid 0 foreach list_of_author_frequency_in_branches [ x -> if (x = length (item tempwayid ways)) [ set ways remove-item tempwayid ways ] set tempwayid tempwayid + 1 ] ifelse (length ways > 0) [ set list_of_author_frequency_in_branches (n-values (length ways) [0]) set tempwaylength 0 set tempwayid 0 foreach ways[ currentway -> foreach currentway [ cw -> if ([author_id] of cw = auth_id) [ set tempwaylength tempwaylength + 1 ] ] set list_of_author_frequency_in_branches replace-item tempwayid list_of_author_frequency_in_branches tempwaylength set tempwayid tempwayid + 1 set tempwaylength 0 ] set tempwayid 0 let tmp_of_author_frequency_in_branches_frex (n-values 4 [0]) let list_of_possible_ids (n-values 4 [[]]) let cur_list_of_possible_ids_elem [] foreach list_of_author_frequency_in_branches [ x -> ifelse (x = 0) [ set tmp_of_author_frequency_in_branches_frex replace-item 0 tmp_of_author_frequency_in_branches_frex (item 0 tmp_of_author_frequency_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 0 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 0 list_of_possible_ids cur_list_of_possible_ids_elem ] [ ifelse ((x / (length (item tempwayid ways))) < (branch_authors_comments_count_limit / 100)) [ set tmp_of_author_frequency_in_branches_frex replace-item 1 tmp_of_author_frequency_in_branches_frex (item 1 tmp_of_author_frequency_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 1 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 1 list_of_possible_ids cur_list_of_possible_ids_elem ] [ ifelse ((x / (length (item tempwayid ways))) < (1 - (branch_authors_comments_count_limit / 100))) [ set tmp_of_author_frequency_in_branches_frex replace-item 2 tmp_of_author_frequency_in_branches_frex (item 2 tmp_of_author_frequency_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 2 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 2 list_of_possible_ids cur_list_of_possible_ids_elem ] [ set tmp_of_author_frequency_in_branches_frex replace-item 3 tmp_of_author_frequency_in_branches_frex (item 3 tmp_of_author_frequency_in_branches_frex + 1) set cur_list_of_possible_ids_elem item 3 list_of_possible_ids set cur_list_of_possible_ids_elem sentence cur_list_of_possible_ids_elem tempwayid set list_of_possible_ids replace-item 3 list_of_possible_ids cur_list_of_possible_ids_elem ] ] ] set tempwayid tempwayid + 1 ] set tempwayid 0 let tmp_of_author_frequency_in_branches_frex_enum [0 1 2 3] foreach tmp_of_author_frequency_in_branches_frex [ x -> if (x = 0) [ set tmp_of_author_frequency_in_branches_frex_enum replace-item tempwayid tmp_of_author_frequency_in_branches_frex_enum [] set list_of_possible_ids replace-item tempwayid list_of_possible_ids [] ] set tempwayid tempwayid + 1 ] set tmp_of_author_frequency_in_branches_frex_enum remove [] tmp_of_author_frequency_in_branches_frex_enum set list_of_possible_ids remove [] list_of_possible_ids let tmp_of_author_frequency_in_branches [] foreach tmp_of_author_frequency_in_branches_frex_enum [ x -> set tmp_of_author_frequency_in_branches sentence tmp_of_author_frequency_in_branches (item x branch_author_comments_count_probability) ] let cur_sum 0 set tempwayid 0 let rand_val random sum tmp_of_author_frequency_in_branches foreach tmp_of_author_frequency_in_branches [ x -> set cur_sum cur_sum + x if (rand_val >= cur_sum - x and rand_val < cur_sum) [ set neededwayid tempwayid ] set tempwayid tempwayid + 1 ] set neededwayid one-of (item neededwayid list_of_possible_ids) ;show ways ;show list_of_author_frequency_in_branches ;show neededwayid set current_author_comments_frex_rules_generation item auth_id authors_comments_frex_rules_generation if (neededwayid > -1)[ ifelse ((item neededwayid list_of_author_frequency_in_branches) = 0) [ set current_author_comments_frex_rules_generation replace-item 0 current_author_comments_frex_rules_generation (item 0 current_author_comments_frex_rules_generation + 1) ] [ ifelse (((item neededwayid list_of_author_frequency_in_branches) / (length (item neededwayid ways))) < (branch_authors_comments_count_limit / 100)) [ set current_author_comments_frex_rules_generation replace-item 1 current_author_comments_frex_rules_generation (item 1 current_author_comments_frex_rules_generation + 1) ] [ ifelse (((item neededwayid list_of_author_frequency_in_branches) / (length (item neededwayid ways))) < (1 - (branch_authors_comments_count_limit / 100))) [ set current_author_comments_frex_rules_generation replace-item 2 current_author_comments_frex_rules_generation (item 2 current_author_comments_frex_rules_generation + 1) ] [ set current_author_comments_frex_rules_generation replace-item 3 current_author_comments_frex_rules_generation (item 3 current_author_comments_frex_rules_generation + 1) ] ] ] ] ;show current_author_comments_frex_rules_generation ] [ set neededwayid -1 ] end to find-all-pairs [ prev_comment cur_comment ] ifelse (cur_comment = -1) [ if (count [in-link-neighbors] of comment prev_comment > 0) [ ask [in-link-neighbors] of comment prev_comment [ find-all-pairs prev_comment who ] ] ] [ let real_intent_referent_pc [intent] of comment prev_comment set real_intent_referent_pc cf:select cf:case [ real_intent_referent_pc = 1 ] [ "а" ] cf:case [ real_intent_referent_pc = 2 ] [ "б" ] cf:case [ real_intent_referent_pc = 3 ] [ "в" ] cf:case [ real_intent_referent_pc = 4 ] [ "г" ] cf:case [ real_intent_referent_pc = 5 ] [ "д" ] cf:case [ real_intent_referent_pc = 6 ] [ "е" ] cf:case [ real_intent_referent_pc = 7 ] [ "ж" ] cf:case [ real_intent_referent_pc = 8 ] [ "з" ] cf:case [ real_intent_referent_pc = 9 ] [ "и" ] cf:case [ real_intent_referent_pc = 10 ] [ "к" ] cf:case [ real_intent_referent_pc = 11 ] [ "л" ] cf:case [ real_intent_referent_pc = 12 ] [ "м" ] cf:case [ real_intent_referent_pc = 13 ] [ "н" ] cf:case [ real_intent_referent_pc = 14 ] [ "о" ] cf:case [ real_intent_referent_pc = 15 ] [ "п" ] cf:case [ real_intent_referent_pc = 16 ] [ "р" ] cf:case [ real_intent_referent_pc = 17 ] [ "с" ] cf:case [ real_intent_referent_pc = 18 ] [ "т" ] cf:case [ real_intent_referent_pc = 19 ] [ "у" ] cf:case [ real_intent_referent_pc = 20 ] [ "ф" ] cf:case [ real_intent_referent_pc = 21 ] [ "х" ] cf:case [ real_intent_referent_pc = 22 ] [ "ц" ] cf:case [ real_intent_referent_pc = 23 ] [ "ч" ] cf:case [ real_intent_referent_pc = 24 ] [ "ш" ] cf:case [ real_intent_referent_pc = 25 ] [ "щ" ] cf:else [ real_intent_referent_pc ] set real_intent_referent_pc word real_intent_referent_pc [referenceObject] of comment prev_comment let real_intent_referent_cc [intent] of comment cur_comment set real_intent_referent_cc cf:select cf:case [ real_intent_referent_cc = 1 ] [ "а" ] cf:case [ real_intent_referent_cc = 2 ] [ "б" ] cf:case [ real_intent_referent_cc = 3 ] [ "в" ] cf:case [ real_intent_referent_cc = 4 ] [ "г" ] cf:case [ real_intent_referent_cc = 5 ] [ "д" ] cf:case [ real_intent_referent_cc = 6 ] [ "е" ] cf:case [ real_intent_referent_cc = 7 ] [ "ж" ] cf:case [ real_intent_referent_cc = 8 ] [ "з" ] cf:case [ real_intent_referent_cc = 9 ] [ "и" ] cf:case [ real_intent_referent_cc = 10 ] [ "к" ] cf:case [ real_intent_referent_cc = 11 ] [ "л" ] cf:case [ real_intent_referent_cc = 12 ] [ "м" ] cf:case [ real_intent_referent_cc = 13 ] [ "н" ] cf:case [ real_intent_referent_cc = 14 ] [ "о" ] cf:case [ real_intent_referent_cc = 15 ] [ "п" ] cf:case [ real_intent_referent_cc = 16 ] [ "р" ] cf:case [ real_intent_referent_cc = 17 ] [ "с" ] cf:case [ real_intent_referent_cc = 18 ] [ "т" ] cf:case [ real_intent_referent_cc = 19 ] [ "у" ] cf:case [ real_intent_referent_cc = 20 ] [ "ф" ] cf:case [ real_intent_referent_cc = 21 ] [ "х" ] cf:case [ real_intent_referent_cc = 22 ] [ "ц" ] cf:case [ real_intent_referent_cc = 23 ] [ "ч" ] cf:case [ real_intent_referent_cc = 24 ] [ "ш" ] cf:case [ real_intent_referent_cc = 25 ] [ "щ" ] cf:else [ real_intent_referent_cc ] set real_intent_referent_cc word real_intent_referent_cc [referenceObject] of comment cur_comment let cur_pair word real_intent_referent_pc word "; " real_intent_referent_cc let needed_id -1 let cur_id 0 foreach all_pairs [ x -> if (x = cur_pair) [ set needed_id cur_id ] set cur_id cur_id + 1 ] ifelse (needed_id > -1) [ set all_pairs_frex replace-item needed_id all_pairs_frex (item needed_id all_pairs_frex + 1) ] [ let temppairs (n-values (length all_pairs + 1) [0]) set cur_id 0 foreach all_pairs [ set temppairs replace-item cur_id temppairs item cur_id all_pairs set cur_id cur_id + 1 ] set temppairs replace-item cur_id temppairs cur_pair set all_pairs temppairs let temppairs_frex (n-values (length all_pairs_frex + 1) [0]) set cur_id 0 foreach all_pairs_frex [ set temppairs_frex replace-item cur_id temppairs_frex item cur_id all_pairs_frex set cur_id cur_id + 1 ] set temppairs_frex replace-item cur_id temppairs_frex 1 set all_pairs_frex temppairs_frex if (count [in-link-neighbors] of comment cur_comment > 0) [ ask [in-link-neighbors] of comment cur_comment [ find-all-pairs cur_comment who ] ] ] ] end to write-to-file let file user-new-file if is-string? file [ if file-exists? file [ file-delete file ] file-open file file-print (word "Vertex1; Vertex2; Frequency") let cur_id 0 foreach all_pairs [ x -> file-print (word x " ; " item cur_id all_pairs_frex) set cur_id cur_id + 1 ] ;file-print "" ; blank line file-close ] end to write-to-file-current-log-authors-statistics let current_author_id 0 while [current_author_id < count_of_authors] [ let file word "tmp1/" word current_author_id word "_" word ticks "_meta" if file-exists? file [ file-delete file ] file-open file ;file-print (log_creation_tick) file-print (item current_author_id authors_comments_generation) ;; Выводим количество сгенерированных комментариев file-print (item current_author_id authors_comments_frex_rules_generation) ;; Выводим частотно-веточную статистику по сгенерированным комментариям file-print (item current_author_id authors_comments_location_rules_generation) ;; Выводим статистику расположения (корень-лист) по сгенерированным комментариям file-close set file word "tmp1/" word current_author_id word "_" word ticks "_log" if file-exists? file [ file-delete file ] file-open file foreach (remove-duplicates item current_author_id authors_comments_generation_log) [ x -> ;; Выводим лог по интентам по сгенерированным комментариям let current_pair_frex 0 foreach (item current_author_id authors_comments_generation_log) [ y -> if (y = x) [ set current_pair_frex current_pair_frex + 1 ] ] show x let first_com_intent read-from-string substring x 0 (position ";" x - 1) show first_com_intent let first_com_referenceObject read-from-string substring x (position ";" x - 1) (position ";" x) show first_com_referenceObject let second_com_intent read-from-string substring x (position ";" x + 1) (length x - 1) show second_com_intent let second_com_referenceObject read-from-string last x show second_com_referenceObject set first_com_intent cf:select cf:case [ first_com_intent = 1 ] [ "а" ] cf:case [ first_com_intent = 2 ] [ "б" ] cf:case [ first_com_intent = 3 ] [ "в" ] cf:case [ first_com_intent = 4 ] [ "г" ] cf:case [ first_com_intent = 5 ] [ "д" ] cf:case [ first_com_intent = 6 ] [ "е" ] cf:case [ first_com_intent = 7 ] [ "ж" ] cf:case [ first_com_intent = 8 ] [ "з" ] cf:case [ first_com_intent = 9 ] [ "и" ] cf:case [ first_com_intent = 10 ] [ "к" ] cf:case [ first_com_intent = 11 ] [ "л" ] cf:case [ first_com_intent = 12 ] [ "м" ] cf:case [ first_com_intent = 13 ] [ "н" ] cf:case [ first_com_intent = 14 ] [ "о" ] cf:case [ first_com_intent = 15 ] [ "п" ] cf:case [ first_com_intent = 16 ] [ "р" ] cf:case [ first_com_intent = 17 ] [ "с" ] cf:case [ first_com_intent = 18 ] [ "т" ] cf:case [ first_com_intent = 19 ] [ "у" ] cf:case [ first_com_intent = 20 ] [ "ф" ] cf:case [ first_com_intent = 21 ] [ "х" ] cf:case [ first_com_intent = 22 ] [ "ц" ] cf:case [ first_com_intent = 23 ] [ "ч" ] cf:case [ first_com_intent = 24 ] [ "ш" ] cf:case [ first_com_intent = 25 ] [ "щ" ] cf:else [ first_com_intent ] set second_com_intent cf:select cf:case [ second_com_intent = 1 ] [ "а" ] cf:case [ second_com_intent = 2 ] [ "б" ] cf:case [ second_com_intent = 3 ] [ "в" ] cf:case [ second_com_intent = 4 ] [ "г" ] cf:case [ second_com_intent = 5 ] [ "д" ] cf:case [ second_com_intent = 6 ] [ "е" ] cf:case [ second_com_intent = 7 ] [ "ж" ] cf:case [ second_com_intent = 8 ] [ "з" ] cf:case [ second_com_intent = 9 ] [ "и" ] cf:case [ second_com_intent = 10 ] [ "к" ] cf:case [ second_com_intent = 11 ] [ "л" ] cf:case [ second_com_intent = 12 ] [ "м" ] cf:case [ second_com_intent = 13 ] [ "н" ] cf:case [ second_com_intent = 14 ] [ "о" ] cf:case [ second_com_intent = 15 ] [ "п" ] cf:case [ second_com_intent = 16 ] [ "р" ] cf:case [ second_com_intent = 17 ] [ "с" ] cf:case [ second_com_intent = 18 ] [ "т" ] cf:case [ second_com_intent = 19 ] [ "у" ] cf:case [ second_com_intent = 20 ] [ "ф" ] cf:case [ second_com_intent = 21 ] [ "х" ] cf:case [ second_com_intent = 22 ] [ "ц" ] cf:case [ second_com_intent = 23 ] [ "ч" ] cf:case [ second_com_intent = 24 ] [ "ш" ] cf:case [ second_com_intent = 25 ] [ "щ" ] cf:else [ second_com_intent ] file-print (word first_com_intent word first_com_referenceObject word ";" word second_com_intent word second_com_referenceObject word ";" current_pair_frex) ] file-close set current_author_id current_author_id + 1 ] end to update-statistics set branches_count length ways let comments_count_in_branches (n-values (length ways) [0]) let cur_id 0 foreach ways [ set comments_count_in_branches replace-item cur_id comments_count_in_branches ((length item cur_id ways) - 1) set cur_id cur_id + 1 ] ;print word "CC: " comments_count_in_branches set comments_count_in_branches_M mean comments_count_in_branches if (length ways > 1) [ set comments_count_in_branches_D standard-deviation comments_count_in_branches ] end to update-authors_comments_location_rules_generation [ auth_id current_comment_in_branch_location branch_length ] let current_author_comments_location_rules_generation item auth_id authors_comments_location_rules_generation ifelse (current_comment_in_branch_location = 0) [ set current_author_comments_location_rules_generation replace-item 0 current_author_comments_location_rules_generation (item 0 current_author_comments_location_rules_generation + 1) ] [ ifelse (current_comment_in_branch_location = (branch_length - 1)) [ set current_author_comments_location_rules_generation replace-item 4 current_author_comments_location_rules_generation (item 4 current_author_comments_location_rules_generation + 1) ] [ ifelse (current_comment_in_branch_location < (branch_length * (branch_author_comments_location_limit / 100))) [ set current_author_comments_location_rules_generation replace-item 1 current_author_comments_location_rules_generation (item 1 current_author_comments_location_rules_generation + 1) ] [ ifelse (current_comment_in_branch_location < (branch_length * ((100 - branch_author_comments_location_limit) / 100))) [ set current_author_comments_location_rules_generation replace-item 2 current_author_comments_location_rules_generation (item 2 current_author_comments_location_rules_generation + 1) ] [ set current_author_comments_location_rules_generation replace-item 3 current_author_comments_location_rules_generation (item 3 current_author_comments_location_rules_generation + 1) ] ] ] ] set authors_comments_location_rules_generation replace-item auth_id authors_comments_location_rules_generation current_author_comments_location_rules_generation ;show authors_comments_location_rules_generation end ;; 2 экземпляра программы: для обобщенной статистики (текущая) + для модели, основанной на файлах лога ;; Визуализация марковской цепи для авторов (в виде кластерной схемы/иерархической/иное) to read_parameters_from_file [ auth_id ] let file word "tmp/" word auth_id word "_" word ((int (ticks / log_creation_tick) + 1) * log_creation_tick) "_meta" file-open file set comment_generation_probability ((round (file-read / log_creation_tick)) * 100) set branch_author_comments_count_probability file-read set branch_author_comments_location_probability file-read file-close end @#$#@#$#@ GRAPHICS-WINDOW 260 60 1234 505 -1 -1 13.233 1 10 1 1 1 0 0 0 1 -36 36 -16 16 0 0 1 ticks 30.0 BUTTON 18 10 81 43 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 20 68 83 101 NIL go T 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 99 68 176 101 go-once go NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 16 129 188 162 count_of_authors count_of_authors 1 10 2.0 1 1 NIL HORIZONTAL BUTTON 15 173 242 206 Write pairs to file write-to-file NIL 1 T OBSERVER NIL NIL NIL NIL 1 MONITOR 16 216 132 261 Count of branches branches_count 17 1 11 MONITOR 16 269 194 314 Mean comments count in branches comments_count_in_branches_M 2 1 11 MONITOR 16 325 195 370 SD of comments count in branches comments_count_in_branches_D 2 1 11 SLIDER 263 10 435 43 log_creation_tick log_creation_tick 1 1000 3.0 1 1 NIL HORIZONTAL SLIDER 452 10 726 43 branch_authors_comments_count_limit branch_authors_comments_count_limit 1 99 10.0 1 1 % HORIZONTAL SLIDER 745 10 1032 43 branch_author_comments_location_limit branch_author_comments_location_limit 1 99 10.0 1 1 % HORIZONTAL @#$#@#$#@ ## WHAT IS IT? (a general understanding of what the model is trying to show or explain) ## HOW IT WORKS (what rules the agents use to create the overall behavior of the model) ## HOW TO USE IT (how to use the model, including a description of each of the items in the Interface tab) ## THINGS TO NOTICE (suggested things for the user to notice while running the model) ## THINGS TO TRY (suggested things for the user to try to do (move sliders, switches, etc.) with the model) ## EXTENDING THE MODEL (suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) ## NETLOGO FEATURES (interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) ## RELATED MODELS (models in the NetLogo Models Library and elsewhere which are of related interest) ## CREDITS AND REFERENCES (a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 15 Circle -1 true true 203 65 88 Circle -1 true true 70 65 162 Circle -1 true true 150 105 120 Polygon -7500403 true false 218 120 240 165 255 165 278 120 Circle -7500403 true false 214 72 67 Rectangle -1 true true 164 223 179 298 Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 Circle -1 true true 3 83 150 Rectangle -1 true true 65 221 80 296 Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 Polygon -7500403 true false 276 85 285 105 302 99 294 83 Polygon -7500403 true false 219 85 210 105 193 99 201 83 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 wolf false 0 Polygon -16777216 true false 253 133 245 131 245 133 Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 6.0.1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@