Диссертация (1137096), страница 56
Текст из файла (страница 56)
Set ;j a v a . u t i l . S o r t ed Map ;java . u t i l . SortedSet ;java . u t i l . Stack ;j a v a . u t i l . Ti m er ;j a v a . u t i l . TreeMap ;java . u t i l . TreeSet ;java . u t i l . Vector ;j a v a . awt . C o l o r ;j a v a . awt . F o n t ;j a v a . awt . G r ap h i cs2 D ;j a v a . awt . geom . A f f i n e T r a n s f o r m ;com . x j .
a n y l o g i c . e n g i n e . c o n n e c t i v i t y . R e s u l t S e t ;com . x j . a n y l o g i c . e n g i n e . c o n n e c t i v i t y . S t a t e m e n t ;com . x j . a n y l o g i c . e n g i n e . markup . Network ;com . x j . a n y l o g i c . e n g i n e . P o s i t i o n ;com . x j . a n y l o g i c . e n g i n e . markup . P e d F l o w S t a t i s t i c s ;com . x j . a n y l o g i c . e n g i n e . markup . D en si t y Map ;import50 i m p o r timportimportimportstaticstaticstaticstaticstatic55 i m p o r timportimportimportimport60importimportimportimport65importcom .com .com .com .com .xjxjxjxjxjstaticstaticstaticstaticjavacom .com .com .com ....... l a n g .
Math . ∗ ;xj . anylogic . engine . U t i l i t i e sA r r ay .∗;xj . anylogic . engine . p res ent at i on . U t i l i t i e s C o l o r .∗;xj . anylogic . engine . p res ent at i on . U til itiesDrawin g .∗;x j . a n y l o g i c . e n g i n e . H y p er A r r ay . ∗ ;anylogic .anylogic .anylogic .anylogic .anylogic .engine .∗;engine . anal ys is .∗;engine . con necti vi ty .∗;e n g i n e . markup . ∗ ;engine . p resen t at io n .∗;crowd .
G en d er . ∗ ;crowd . S t a t u s . ∗ ;crowd . S i t u a t i o n . ∗ ;crowd . E x i t . ∗ ;j a v a . awt . geom . Arc2D ;p u b l i c c l a s s P e r s o n e x t e n d s A g en t{70/ / Параметры75/ ∗∗∗ Возраст агента∗/publici n t ag e ;/ ∗∗∗ Возвращает з н а ч е н и е по умолчанию параметра <code >age </ code > .∗ <i >П о л ь зо в а т ел ь не должен вызывать этот метод </ i >∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ipublic i n t _age_DefaultValue_xjal () {f i n a l Person s e l f = t h i s ;return80850;}9095100p u b l i c v o i d s e t _ a g e ( i n t ag e ) {i f ( ag e == t h i s . ag e ) {return ;}i n t _ o l d V a l u e _ x j a l = t h i s .
ag e ;t h i s . ag e = ag e ;onChange_age_xjal ( _oldValue_xjal ) ;onChange ( ) ;}/ ∗∗∗ C a l l s " On ch a n g e " a c t i o n f o r p a r a m e t e r age . < br >254∗ No t e t h a t ’ o l d V a l u e ’ i n t h a t a c t i o n w i l l be u n a v a i l a b l e i f t h i s m et h o d i s c a l l e d by u s e r∗ ( c u r r e n t p a r a m e t e r v a l u e w i l l be p a s s e d a s ’ o l d V a l u e ’ ) . < br >∗ P l e a s e c a l l <code > s e t _ a g e ( ) </ code > m et h o d i n s t e a d .∗/v o i d o n Ch an g e_ ag e ( ) {o n C h a n g e _ a g e _ x j a l ( ag e ) ;}105110115@ A n y Lo g i cI n t er n al Co d eg en A P Ivoid onChange_age_xjal ( i n t oldValue ) {}/ ∗∗∗ Пол агента∗/publicG en d er g e n d e r ;120/ ∗∗∗ Возвращает з н а ч е н и е по умолчанию параметра <code >g en d er </ code > .∗ <i >П о л ь зо в а т ел ь не должен вызывать этот метод </ i >∗/125@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c G en d er _ g e n d e r _ D e f a u l t V a l u e _ x j a l ( ) {f i n a l Person s e l f = t h i s ;returnG en d er .
F em al e130 ;}p u b l i c v o i d s e t _ g e n d e r ( G en d er g e n d e r ) {i f ( g e n d e r == t h i s . g e n d e r ) {return ;}G en d er _ o l d V a l u e _ x j a l = t h i s . g e n d e r ;t h i s . gender = gender ;onChange_gender_xjal ( _oldValue_xjal ) ;onChange ( ) ;}135140/ ∗∗∗ C a l l s " On ch a n g e " a c t i o n f o r p a r a m e t e r g e n d e r . < br >∗ No t e t h a t ’ o l d V a l u e ’ i n t h a t a c t i o n w i l l be u n a v a i l a b l e i f t h i s m et h o d i s c a l l e d by u s e r∗ ( c u r r e n t p a r a m e t e r v a l u e w i l l be p a s s e d a s ’ o l d V a l u e ’ ) . < br >∗ P l e a s e c a l l <code > s e t _ g e n d e r ( ) </ code > m et h o d i n s t e a d .∗/v o i d o n Ch an g e_ g en d er ( ) {onChange_gender_xjal ( gender ) ;}145150@ A n y Lo g i cI n t er n al Co d eg en A P Iv o i d o n C h a n g e _ g e n d e r _ x j a l ( G en d er o l d V a l u e ) {}155/ ∗∗∗ Комфортная скорость ходьбы160∗/publicd o u b l e v_comf ;/ ∗∗∗ Возвращает з н а ч е н и е по умолчанию параметра <code >v_comf </ code > .∗ <i >П о л ь зо в а т ел ь не должен вызывать этот метод </ i >∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c double _v_comf_DefaultValue_xjal ( ) {f i n a l Person s e l f = t h i s ;return1651700;}175180p u b l i c v o i d s e t _ v _ c o m f ( d o u b l e v_comf ) {i f ( v_comf == t h i s .
v_comf ) {return ;}d o u b l e _ o l d V a l u e _ x j a l = t h i s . v_comf ;t h i s . v_comf = v_comf ;o n C h a n g e _ v _ c o m f _ x j al ( _ o l d V a l u e _ x j a l ) ;onChange ( ) ;255}185/ ∗∗∗ C a l l s " On ch a n g e " a c t i o n f o r p a r a m e t e r v_ co m f . < br >∗ No t e t h a t ’ o l d V a l u e ’ i n t h a t a c t i o n w i l l be u n a v a i l a b l e i f t h i s m et h o d i s c a l l e d by u s e r∗ ( c u r r e n t p a r a m e t e r v a l u e w i l l be p a s s e d a s ’ o l d V a l u e ’ ) .
< br >∗ P l e a s e c a l l <code > s e t _ v _ c o m f ( ) </ code > m et h o d i n s t e a d .∗/v o i d onChange_v_comf ( ) {o n C h a n g e _ v _ c o m f _ x j al ( v_comf ) ;}190195@ A n y Lo g i cI n t er n al Co d eg en A P Ivoid onChange_v_comf_xjal( double oldValue ) {}200/ ∗∗∗ Максимальная скорость ходьбы∗/public205 d o u b l e v_max ;/ ∗∗∗ Возвращает з н а ч е н и е по умолчанию параметра <code >v_max </ code > .∗ <i >П о л ь зо в а т ел ь не должен вызывать этот метод </ i >∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c double _v_max_DefaultValue_xjal ( ) {f i n a l Person s e l f = t h i s ;return210215 0;}p u b l i c v o i d set _ v _ m ax ( d o u b l e v_max ) {i f ( v_max == t h i s . v_max ) {return ;}d o u b l e _ o l d V a l u e _ x j a l = t h i s .
v_max ;t h i s . v_max = v_max ;o n Ch an g e_ v _ m ax _ x j al ( _ o l d V a l u e _ x j a l ) ;onChange ( ) ;}220225/ ∗∗∗ C a l l s " On ch a n g e " a c t i o n f o r∗ No t e t h a t ’ o l d V a l u e ’ i n t h a t∗ ( c u r r e n t parameter value w i l l∗ P l e a s e c a l l <code >s e t _ v _ m a x ( )∗/v o i d onChange_v_max ( ) {o n Ch an g e_ v _ m ax _ x j al ( v_max ) ;}230235@ A n y Lo g i cI n t er n al Co d eg en A P Iv o i d o n Ch an g e_ v _ m ax _ x j al ( d o u b l e o l d V a l u e ) {}240245p a r a m e t e r v_max . < br >a c t i o n w i l l be u n a v a i l a b l e i f t h i s m et h o d i s c a l l e d by u s e rbe p a s s e d a s ’ o l d V a l u e ’ ) .
< br ></ code > m et h o d i n s t e a d ./ ∗∗∗ Максимальная скорость б е г а∗/publicd o u b l e v _ h at _ m ax ;250/ ∗∗∗ Возвращает з н а ч е н и е по умолчанию параметра <code >v_ h a t _ m a x </ code > .∗ <i >П о л ь зо в а т ел ь не должен вызывать этот метод </ i >∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ip u b l i c double _v_hat_max_DefaultValue_xjal ( ) {f i n a l Person s e l f = t h i s ;return2550;260}265p u b l i c v o i d s e t _ v _ h a t _ m a x ( d o u b l e v _ h at _ m ax ) {i f ( v _ h at _ m ax == t h i s .
v _ h at _ m ax ) {return ;}256d o u b l e _ o l d V a l u e _ x j a l = t h i s . v _ h at _ m ax ;t h i s . v _ h at _ m ax = v _ h at _ m ax ;onChange_v_hat_max_xjal( _oldValue_xjal ) ;onChange ( ) ;270275280}/ ∗∗∗ C a l l s " On ch a n g e " a c t i o n f o r p a r a m e t e r v_ h a t _ m a x . < br >∗ No t e t h a t ’ o l d V a l u e ’ i n t h a t a c t i o n w i l l be u n a v a i l a b l e i f t h i s m et h o d i s c a l l e d by u s e r∗ ( c u r r e n t p a r a m e t e r v a l u e w i l l be p a s s e d a s ’ o l d V a l u e ’ ) .
< br >∗ P l e a s e c a l l <code >s e t _ v _ h a t _ m a x ( ) </ code > m et h o d i n s t e a d .∗/v o i d o n Ch an g e_ v _ h at _ m ax ( ) {o n C h a n g e _ v _ h a t _ m a x _ x j a l ( v _ h at _ m ax ) ;}@ A n y Lo g i cI n t er n al Co d eg en A P Ivoid onChange_v_hat_max_xjal( double oldValue ) {}285290295300305310315320325330/ ∗∗∗ Статус агента∗/publicStatusstatus ;/ ∗∗∗ Возвращает з н а ч е н и е по умолчанию параметра <code > s t a t u s </ code > .∗ <i >П о л ь зо в а т ел ь не должен вызывать этот метод </ i >∗/@ A n y Lo g i cI n t er n al Co d eg en A P Ipublic Status _status_DefaultValue_xjal () {f i n a l Person s e l f = t h i s ;returnStatus .