Диссертация (1137096), страница 20
Текст из файла (страница 20)
g e t R o o t ( ) ) ; / / з а п у с к п р о го н а;}break ;case _ bu tt o n_ gl ob a l_ d is t r : {ShapeButton s e l f = t h i s . b u t t o n _ g l o b a l _ d i s t r ;i t e r ++;var_agents_count =box_agents_count . getIntValue ( ) ;box_agents_count_new . s e t T e x t ( var _agents_count ) ;G l o b a l D i s t r ( v a r _ m v e r t ∗v ar _ m h o r ) ;GlobalDistr_coll . clear () ;r e c t a n g l e _ g l o b a l _ d i s t r . s e t H e i g h t ( Max Rect an g l e ( ) . h e i g h t ) ;r e c t a n g l e _ g l o b a l _ d i s t r .
s e t W i d t h ( Max Rect an g l e ( ) . w i d t h ) ;v i e w A r e a _ g l o b a l _ d i s t r . n a v i g a t e T o ( ) ; / / п ер ехо д к области за да н и я р а с п р е д е л е н и я агентов в клетках;}break ;case _button_end : {ShapeButton s e l f = t h i s . button_end ;int i ;i n t sum = 0 ;f o r ( i = 0 ; i < v a r _ m v e r t ∗v ar _ m h o r ; i ++) { / / расчет общего ко л и ч ест в а агентовsum = sum + b o x _ c o l l .
g e t ( i ) . g e t I n t V a l u e ( ) ;}i f ( sum ! = v a r _ a g e n t s _ c o u n t ) { / / п р о в ер ка общего ко л и ч ест в а агентовMessageBox . WarningBox ( " Сумма к о л и ч е с т в а а г е н т о в в к л е т к а х не с о в п а д а е т с общим числом а г е н т о в ! " , " Ошибка в в о да " ) ;} else {GlobalDistr_coll . clear () ;f o r ( i = 0 ; i < v a r _ m v e r t ∗v ar _ m h o r ; i ++) { / / п р и с в о е н и е ко л и ч ест в а агентов в клетке зн а ч ен и ям к о л л е к ц и иG l o b a l D i s t r _ c o l l .
add ( i , b o x _ c o l l . g e t ( i ) . g e t I n t V a l u e ( ) ) ;p r e s e n t a t i o n . remove ( b o x _ c o l l . g e t ( i ) ) ; / / у д а л е н и е тектового п о л яp r e s e n t a t i o n . remove ( t e x t _ c o l l . g e t ( i ) ) ; / / у д а л е н и е п о дп и си тектового п о л я}box_coll .
cl ear () ;text_coll . clear () ;v i e w A r e a _ b a s e . n a v i g a t e T o ( ) ; / / в о зв р а щ ен и е к н а ч а л ь н о й области п р езен т а ц и и};}break ;case _button1 : {ShapeButton s e l f = t h i s . button1 ;d e l e t e ( ) ; / / п о л н а я очистка базы данныхv e r s i o n ( ) ; / / п е р е п р и с в о е н и е в е р с и и п р о го н а;}break ;default :s u p e r . e x e c u t e S h a p e C o n t r o l A c t i o n ( _ sh ap e , i n d e x ) ;break ;140}895900905910915}@ O v er r i d e@ 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 e x e c u t e S h a p e C o n t r o l A c t i o n ( i n t _ sh ap e , i n t i n d e x , i n t v a l u e ) {switch ( _shape ) {case _ ra d i o _ gl o b a l_ d i s t r : {ShapeRadioButtonGroup s e l f = t h i s .
r a d i o _ g l o b a l _ d i s t r ;i f ( r a d i o _ g l o b a l _ d i s t r . g e t V a l u e ( ) ==1) {var_global_distr=true ;button_global_distr . setVisible ( true ) ;} else {var_global_distr= false ;button_global_distr . setVisible ( false ) ;};}break ;default :s u p e r . e x e c u t e S h a p e C o n t r o l A c t i o n ( _ sh ap e , i n d e x , v a l u e ) ;break ;}}@ O v er r i d e@ A n y Lo g i cI n t er n al Co d eg en A P I920p u b l i c v o i d e x e c u t e S h a p e C o n t r o l A c t i o n ( i n t _ sh ap e , i n t i n d e x , d o u b l e v a l u e ) {switch ( _shape ) {case _s lider_ age nts _co unt :var_agents_count = ( i n t ) value ; {ShapeSlider s el f = t h i s .
sli der_agents_ co unt ;925 v a r _ a g e n t s _ c o u n t = s l i d e r _ a g e n t s _ c o u n t . g e t I n t V a l u e ( ) ;box_agents_count . setText ( s li de r_a ge nts _ co unt . getIntValue ( ) ) ;i t e r =0;;}break ;930default :s u p e r . e x e c u t e S h a p e C o n t r o l A c t i o n ( _ sh ap e , i n d e x , v a l u e ) ;break ;}}935940945950955960965970975@ O v er r i d e@ 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 e x e c u t e S h a p e C o n t r o l A c t i o n ( i n t _ sh ap e , i n t i n d e x , S t r i n g v a l u e ) {switch ( _shape ) {c a s e _ b o x _ m v er t :var_mvert = I n t e g e r .
p a r s e I n t ( value ) ; {S h a p e T e x t F i e l d s e l f = t h i s . b o x _ m v er t ;v a r _ m v e r t = b o x _ m v er t . g e t I n t V a l u e ( ) ;i t e r =0;;}break ;c a s e _box_mhor :v ar _ m h o r = I n t e g e r . p a r s e I n t ( v a l u e ) ; {S h a p e T e x t F i e l d s e l f = t h i s . box_mhor ;v ar _ m h o r =box_mhor . g e t I n t V a l u e ( ) ;i t e r =0;;}break ;c a s e _combobox :v ar _ d i s t r = value ; {ShapeComboBox s e l f = t h i s . combobox ;i f ( combobox .
g e t V a l u e ( ) == " Равномерное р асп р едел ен и е " ) {text15 . setVisible ( false ) ;box_c_trian_x . set V i s i b le ( f al s e ) ;text11 . setVisible ( false ) ;box_b_lapl_x . se tV i s i b l e ( f al s e ) ;text12 . setVisible ( false ) ;box_a_lapl_x . se tV i s i b l e ( f al s e ) ;text13 . setVisible ( false ) ;box_mu_norm_x . s e t V i s i b l e ( f a l s e ) ;text14 . setVisible ( false ) ;b o x _ si g _ n o r m _ x . s e t V i s i b l e ( f a l s e ) ;text117 . s et V i si b l e ( f a l se ) ;box_c_trian_y . set V i s i b le ( f al s e ) ;text120 . s et V i si b l e ( f a l se ) ;box_b_lapl_y .
se tV i s i b l e ( f al s e ) ;text121 . s et V i si b l e ( f a l se ) ;box_a_lapl_y . se tV i s i b l e ( f al s e ) ;text118 . s et V i si b l e ( f a l se ) ;141box_mu_norm_y . s e t V i s i b l e ( f a l s e ) ;text119 . s et V i si b l e ( f a l se ) ;b o x _ si g _ n o r m _ y . s e t V i s i b l e ( f a l s e ) ;} e l s e i f ( combobox . g e t V a l u e ( ) == " Нормальное р асп р едел ен и е " ) {980text15 .
setVisible ( false ) ;box_c_trian_x . set V i s i b le ( f al s e ) ;text11 . setVisible ( false ) ;box_b_lapl_x . se tV i s i b l e ( f al s e ) ;text12 . setVisible ( false ) ;985box_a_lapl_x . se tV i s i b l e ( f al s e ) ;text13 . setVisible ( false ) ;box_mu_norm_x . s e t V i s i b l e ( f a l s e ) ;text14 . setVisible ( false ) ;b o x _ si g _ n o r m _ x . s e t V i s i b l e ( f a l s e ) ;990text117 .
s et V i si b l e ( f a l se ) ;box_c_trian_y . set V i s i b le ( f al s e ) ;text120 . s et V i si b l e ( f a l se ) ;box_b_lapl_y . se tV i s i b l e ( f al s e ) ;text121 . s et V i si b l e ( f a l se ) ;995box_a_lapl_y . se tV i s i b l e ( f al s e ) ;text118 . s et V i si b l e ( f a l se ) ;box_mu_norm_y . s e t V i s i b l e ( f a l s e ) ;text119 . s et V i si b l e ( f a l se ) ;b o x _ si g _ n o r m _ y . s e t V i s i b l e ( f a l s e ) ;1000t e x t 1 3 . setX ( 50) ;t e x t 1 3 . setY ( 500) ;text13 . setZ (0) ;box_mu_norm_x . s e t X ( 2 9 0 ) ;box_mu_norm_x .
s e t Y ( 4 9 5 ) ;1005t e x t 1 4 . setX ( 50) ;t e x t 1 4 . setY ( 530) ;text14 . setZ (0) ;b o x _ si g _ n o r m _ x . s e t X ( 2 9 0 ) ;b o x _ si g _ n o r m _ x . s e t Y ( 5 2 5 ) ;1010text118 . setX ( 50) ;text118 . setY ( 560) ;text118 . setZ (0) ;box_mu_norm_y . s e t X ( 2 9 0 ) ;box_mu_norm_y . s e t Y ( 5 5 5 ) ;1015text119 . setX ( 50) ;text119 .
setY ( 590) ;text119 . setZ (0) ;b o x _ si g _ n o r m _ y . s e t X ( 2 9 0 ) ;b o x _ si g _ n o r m _ y . s e t Y ( 5 8 5 ) ;1020text13 . setVisible ( true ) ;box_mu_norm_x . s e t V i s i b l e ( t r u e ) ;text14 . setVisible ( true ) ;b o x _ si g _ n o r m _ x . s e t V i s i b l e ( t r u e ) ;text118 . s et V i si b l e ( true ) ;1025box_mu_norm_y . s e t V i s i b l e ( t r u e ) ;text119 . s et V i si b l e ( true ) ;b o x _ si g _ n o r m _ y .
s e t V i s i b l e ( t r u e ) ;} e l s e i f ( combobox . g e t V a l u e ( ) == " Тр еу го л ь н о е р асп р едел ен и е " ) {text11 . setVisible ( false ) ;1030box_b_lapl_x . se tV i s i b l e ( f al s e ) ;text12 . setVisible ( false ) ;box_a_lapl_x . se tV i s i b l e ( f al s e ) ;text13 . setVisible ( false ) ;box_mu_norm_x .
s e t V i s i b l e ( f a l s e ) ;1035text14 . setVisible ( false ) ;b o x _ si g _ n o r m _ x . s e t V i s i b l e ( f a l s e ) ;text15 . setVisible ( false ) ;box_c_trian_x . set V i s i b le ( f al s e ) ;text117 . s et V i si b l e ( f a l se ) ;1040box_c_trian_y . set V i s i b le ( f al s e ) ;text120 .
s et V i si b l e ( f a l se ) ;box_b_lapl_y . se tV i s i b l e ( f al s e ) ;text121 . s et V i si b l e ( f a l se ) ;box_a_lapl_y . se tV i s i b l e ( f al s e ) ;1045text118 . s et V i si b l e ( f a l se ) ;box_mu_norm_y . s e t V i s i b l e ( f a l s e ) ;text119 . s et V i si b l e ( f a l se ) ;b o x _ si g _ n o r m _ y . s e t V i s i b l e ( f a l s e ) ;t e x t 1 5 .
setX ( 50) ;1050t e x t 1 5 . setY ( 500) ;text15 . setZ (0) ;box_c_tr ian_x . setX ( 290) ;box_c_tr ian_x . setY ( 495) ;text117 . setX ( 50) ;1055text117 . setY ( 530) ;text117 . setZ (0) ;box_c_tr ian_y . setX ( 290) ;142box_c_tr ian_y . setY ( 525) ;text15 . setVisible ( true ) ;1060box_c_trian_x . set V i s i b le ( tru e ) ;text117 . s et V i si b l e ( true ) ;box_c_trian_y . set V i s i b le ( tru e ) ;} else {text15 . setVisible ( false ) ;1065box_c_trian_x . set V i s i b le ( f al s e ) ;text11 . setVisible ( false ) ;box_b_lapl_x .