Диссертация (1137096), страница 55
Текст из файла (страница 55)
g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) ) {x _ e x i t = a21 ;y_exit = y_try ;} else {7080x _ e x i t = a21 ;y _ e x i t = b22−p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ;}}p e r s o n . g e t ( k ) . setXYZ ( x _ t r y , y _ t r y , 0 ) ;7085person . get ( k ) . x = x_try ;person . get ( k ) . y = y_try ;MyVector v ec = new MyVector ( x _ e x i t , y _ e x i t , x _ t r y , y _ t r y ) ;p e r s o n .
g e t ( k ) . d_x = v ec . u n i t V e c t o r ( ) . g et X ( ) ;p e r s o n . g e t ( k ) . D_x = v ec . u n i t V e c t o r ( ) . g et X ( ) ;7090p e r s o n . g e t ( k ) . d_y = v ec . u n i t V e c t o r ( ) . g et Y ( ) ;p e r s o n . g e t ( k ) . D_y = v ec . u n i t V e c t o r ( ) . g et Y ( ) ;person . get ( k ) . s e t _ e x i t ( Exit . values () [ l ]) ;person . get ( k ) . x_exit = x_exit ;person .
get ( k ) . y_exit = y_exit ;7095p e r s o n . g e t ( k ) . moveTo ( x _ e x i t , y _ e x i t ) ;k ++;}}} else {7100f o r ( i n t i = 0 ; i < m _ v er t ∗m_hor ; i ++) {f o r ( i n t j = 0 ; j < g l o b a l _ d i s t r _ a r r a y [ i ] ; j ++) {x _ t r y = a0 + ( i % m_hor ) ∗ l e n 1 / m_hor + s t e p + l a p l a c e ( s c a l e . t o P i x e l s ( a _ l a p l _ x , LENGTH_UNIT_METER ) , l e n 1 / m_hor/2− s t e p + b _ l a p l _ x ∗( l e n 1/ m_hor/2− s t e p ) ) ;y _ t r y = b0 + Math .
f l o o r ( i / m_hor ) ∗ l e n 2 / m _ v er t + s t e p + l a p l a c e ( s c a l e . t o P i x e l s ( a _ l a p l _ y , LENGTH_UNIT_METER ) , l e n 2 / m _ v er t /2− s t e p +b _ l a p l _ y ∗( l e n 2 / m _ v er t /2− s t e p ) ) ;i f ( d i s t r _ e x i t . e q u a l s ( " Равномерное р асп р едел ен и е " ) ) {7105l=bernoulli (0.5) ;} else {l = b e r n o u l l i ( ( x _ t r y−a11 ) / l e n 1 ) ;}i f ( l ==0) {7110i f ( y _ t r y <b11+ p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) {x _ e x i t = a11 ;y _ e x i t = b11+ p e r s o n .
g e t ( k ) . a r e a . g e t R a d i u s X ( ) ;} e l s e i f ( ( y _ t r y >=b11+ p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) &&( y _ t r y <=b12−p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) ) {x _ e x i t = a11 ;7115y_exit = y_try ;} else {x _ e x i t = a11 ;y _ e x i t = b12−p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ;}7120} else {i f ( y _ t r y <b21+ p e r s o n .
g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) {7050249x _ e x i t = a21 ;y _ e x i t = b21+ p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ;} e l s e i f ( ( y _ t r y >=b21+ p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) &&( y _ t r y <=b22−p e r s o n . g e t ( k ) . a r e a . g e t R a d i u s X ( ) ) ) {x _ e x i t = a21 ;y_exit = y_try ;} else {x _ e x i t = a21 ;y _ e x i t = b22−p e r s o n . g e t ( k ) .
a r e a . g e t R a d i u s X ( ) ;}71257130}p e r s o n . g e t ( k ) . setXYZ ( x _ t r y , y _ t r y , 0 ) ;person . get ( k ) . x = x_try ;person . get ( k ) . y = y_try ;MyVector v ec = new MyVector ( x _ e x i t , y _ e x i t ,p e r s o n . g e t ( k ) . d_x = v ec . u n i t V e c t o r ( ) . g et X ( )p e r s o n .
g e t ( k ) . D_x = v ec . u n i t V e c t o r ( ) . g et X ( )p e r s o n . g e t ( k ) . d_y = v ec . u n i t V e c t o r ( ) . g et Y ( )p e r s o n . g e t ( k ) . D_y = v ec . u n i t V e c t o r ( ) . g et Y ( )person . get ( k ) . s e t _ e x i t ( Exit . values () [ l ]) ;person .
get ( k ) . x_exit = x_exit ;person . get ( k ) . y_exit = y_exit ;p e r s o n . g e t ( k ) . moveTo ( x _ e x i t , y _ e x i t ) ;k ++;713571407145x_try , y_try ) ;;;;;}}}}7150/ ∗∗∗ П р и св о ен и е н а ч а л ь н ы х з н а ч е н и й простым переменным<br>∗ <em> T h i s m et h o d i s n ’ t d e s i g n e d t o be c a l l e d by u s e r and may be rem o ved i n f u t u r e r e l e a s e s . < / em>∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c void s e t u p P l a i n V a r i a b l e s _ x j a l ( ) {setupPlainVariables_Main_xjal () ;}7155/ ∗∗∗ П р и св о ен и е н а ч а л ь н ы х з н а ч е н и й простым переменным<br>∗ <em> T h i s m et h o d i s n ’ t d e s i g n e d t o be c a l l e d by u s e r and may be rem o ved i n f u t u r e r e l e a s e s .
< / em>∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ip r i v a t e void set u p P l ai n V ar i ab l es_ Mai n _ x j al ( ) {saved =716071650;}71707175/ / API п о л ь зо в а т ел я −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−@ A n y Lo g i cI n t er n al Co d eg en A P Is t a t i c L i n k T o A g e n t A n i m a t i o n S e t t i n g s _ c o n n e c t i o n s _ c o m m o n A n i m a t i o n S e t t i n g s _ x j a l = new L i n k T o A g e n t A n i m a t i o n S e t t i n g s I m p l ( f a l s e , b l a c k , 1 .
0 ,LINE_STYLE_SOLID , ARROW_NONE, 0 . 0 ) ;p u b l i c L i n k T o A g e n t C o l l e c t i o n <Agent , Agent > c o n n e c t i o n s = new L i n k T o A g e n t S t a n d a r d I m p l <Agent , Agent >( t h i s ,_connections_commonAnimationSettings_xjal ) ;@ O v er r i d ep u b l i c L i n k T o A g e n t C o l l e c t i o n <? e x t e n d s Agent , ? e x t e n d s Agent > g e t L i n k T o A g e n t S t a n d a r d _ x j a l ( ) {return connections ;}71807185719071957200@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c v o i d d r aw Li n k sTo A g e n t s ( b o o l e a n _ u n d e r A g e n t s _ x j a l , Li n k To A g en t A n i m at o r _ a n i m a t o r _ x j a l ) {s u p e r .
d r aw Li n k sTo A g e n t s ( _ u n d e r A g e n t s _ x j a l , _ a n i m a t o r _ x j a l ) ;i f ( _underAgents_xjal ) {_ a n i m a t o r _ x j a l . d r aw Li n k ( t h i s , c o n n e c t i o n s , t r u e , t r u e ) ;}}p u b l i c List <Object > getEmbeddedObjects ( ) {List <Object > l i s t = super . getEmbeddedObjects ( ) ;i f ( l i s t == n u l l ) {l i s t = new L i n k e d L i s t < O b j e c t > ( ) ;}l i s t .
add ( e x p l o s i o n ) ;l i s t . add ( p e r s o n ) ;return l i s t ;}p u b l i c A g e n t L i s t <? e x t e n d s Main > g e t P o p u l a t i o n ( ) {r e t u r n ( A g e n t L i s t <? e x t e n d s Main >) s u p e r . g e t P o p u l a t i o n ( ) ;}250p u b l i c L i s t <? e x t e n d s Main > a g e n t s I n R a n g e ( d o u b l e d i s t a n c e ) {r e t u r n ( L i s t <? e x t e n d s Main >) s u p e r . a g e n t s I n R a n g e ( d i s t a n c e ) ;}7205/ / Действие при и зм ен ен и и −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−p u b l i c v o i d onChange ( ) {s u p e r .
onChange ( ) ;p a u s e . onChange ( ) ;}7210@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c void onDestroy ( ) {s t a r t . onDestroy ( ) ;l i n e _ c l e a n . onDestroy ( ) ;c o o r d i n a t e s . onDestroy ( ) ;pause . onDestroy ( ) ;_ p l o t _ s t _ a u t o U p d a t e E v e n t _ x j a l . onDestroy ( ) ;_plot_saved_autoUp da teE v ent _xj al . onDestroy ( ) ;_autoCr eatedDS_xjal . onDestroy ( ) ;f o r ( A g en t _ i t e m : e x p l o s i o n ) {_item . onDestroy ( ) ;}f o r ( A g en t _ i t e m : p e r s o n ) {_item . onDestroy ( ) ;}/ / Отмена р еги ст р а ц и и в н еп р ер ы в н о й части исполняющего модуля En g i n egetEngine () .
unregisterAgentWithEquations ( t h i s ) ;database . destroy () ;_ds_t . destroyUpdater_xjal ( ) ;_plot_st_expression0_dataSet_xjal . destroyUpdater_xjal () ;_plot_st_expression1_dataSet_xjal . destroyUpdater_xjal () ;_plot_st_expression2_dataSet_xjal . destroyUpdater_xjal () ;_plot_st_expression3_dataSet_xjal . destroyUpdater_xjal () ;_plot_saved_expression0_dataSet_xjal . destroyUpdater_xjal () ;super . onDestroy ( ) ;}72157220722572307235724072457250/ / Дополнительный к л а с с кодаp u b l i c ShapeLine [ ] Line_hor ;p u b l i c ShapeLine [ ] L i n e _ v e r t ;public i n t expl = 0;f i n a l d o u b l e ed g e_ x = 8 ;f i n a l d o u b l e ed g e_ y = 5 ;f i n a l double period = 0 .
1 ;/ / Конец до п о л н и т ел ь н о го к л а с с а кода/ ∗∗∗ Это ч и сл о и с п о л ь з у е т с я при со хр а н ен и и состояния модели . П о л ь зо в а т ел ь не должен изменять е г о з н а ч е н и е .∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ip r i v a t e s t a t i c f i n a l l o n g s e r i a l V e r s i o n U I D = −9043181996024581462 L ;7255 }251В.3 Скрин окна статистики252Приложение ГКласс агентаГ.1 Скрин класса агентаГ.2p a c k a g e crowd ;import5 importimportimportimportimport10 i m p o r timportimportimportimport15 i m p o r timportimportimportimportjavajavajavajavajavajavajavajavajavajavajavajavajavajavajavajava................io .
S er i al iz ab le ;s q l . Connection ;s q l . S Q LEx cep t i o n ;u t i l . A r r ay D eq u e ;u t i l . ArrayList ;u t i l . Arrays ;u t i l . Calendar ;ut i l . Collection ;ut il . Collections ;u t i l . Comparator ;u t i l . Currency ;u t i l . D at e ;u t i l . Enumeration ;u t i l . HashMap ;u t i l . H ash S et ;u t i l . Hashtable ;Листинг кода класса агента25320 i m p o r timportimportimportimport25 i m p o r timportimportimportimport30 i m p o r timportimportimportimport35 i m p o r timportimportimportimport40 i m p o r timportimportimportimport45 i m p o r timportimportjava . u t i l .
I t e r a t o r ;j a v a . u t i l . LinkedHashMap ;java . u t i l . LinkedHashSet ;java . u t i l . LinkedList ;java . u t i l . List ;java . u t i l . L i s t I t e r a t o r ;java . u t i l . Locale ;j a v a . u t i l . Map ;java . u t i l . PriorityQueue ;j a v a . u t i l . Random ;java . u t i l .