//---------------------------------------------- Lubliniec - Pawonków ----------------------------------------------

//node -1 0 lbc eventlauncher 0.0 0.0 0.0 -1 none 2031 losuj_lbc none end

event losuj_lbc_onstart multiple 0.0 none losuj_lbc1 wywoluj_lbc endevent

event losuj_lbc1 multiple 1.0 none paw_a_shp_off condition propability 0.2 endevent //0.2

event wywoluj_lbc multiple 2.0 none lbc1 lbc2 endevent

node -1 0 l61+l144_tlk-1 sound 9950.351 261 -8084.896 l61+l144_tlk-1.wav endsound
event l61+l144_tlk-1 sound 0.0 l61+l144_tlk-1 1 endevent

event lbc1 multiple 20.0 paw_a_shp_mem l61+l144_tlk-1 lbc1.1 condition memcompare * * 1 endevent

event lbc1.1 multiple 90.0 none
	przejazd1lbc_zamykaj
	LBC_przejazd33_zamykaj
	LBC_przejazd03ww_zamykaj
	Lbc_109bd
	Lbc_106bd
	Lbc_103-
	Lbc_100-
	lbc_m_s10
	//lbc1.2
endevent

//node -1 0 l61+l144_tlk-3 sound 9950.351 261 -8084.896 l61+l144_tlk-3.wav endsound
//event l61+l144_tlk-3 sound 0.0 l61+l144_tlk-3 1 endevent

//event lbc1.2 multiple 10.0 none l61+l144_tlk-3 endevent

node -1 0 l61+l144_tlk-2 sound 9950.351 261 -8084.896 l61+l144_tlk-2.wav endsound
event l61+l144_tlk-2 sound 0.0 l61+l144_tlk-2 1 endevent

event lbc2 multiple 30.0 paw_a_shp_mem l61+l144_tlk-2 lbc2.1 condition memcompare * * 0 endevent

event lbc2.1 multiple 15.0 none
	przejazd1lbc_zamykaj
	LBC_przejazd33_zamykaj
	LBC_przejazd03ww_zamykaj
	Lbc_109bd
	Lbc_106bd
	Lbc_103-
	lbc_m_s10
	//lbc1.2
endevent

event przejazd1lbc:free multiple 0.0 none przejazd1lbc_otwieraj1 endevent

event LBC_przejazd33:free multiple 0.0 none LBC_przejazd33_otwieraj1 gadka3_losuj endevent

event LBC_przejazd03ww:free multiple 0.0 none LBC_przejazd03ww_otwieraj1 endevent

node -1 0 cell2 memcell 0 0 0 none 0 0 none endmemcell
event change0_cell2 updatevalues 0.0 cell2 * * 0 endevent
event change1_cell2 updatevalues 0.0 cell2 * * 1 endevent
event change2_cell2 updatevalues 0.0 cell2 * * 2 endevent
event change3_cell2 updatevalues 0.0 cell2 * * 3 endevent
event changeA_cell2 updatevalues 0.0 cell2 * 1 * endevent //sygnalizacja zjechania z Pld_1

node -1 0 gadka3 sound 11459.826 261 -7732.369 gadka3.wav endsound
event gadka3 sound 0.0 gadka3 1 endevent

event gadka3_losuj multiple 0.0 none change1_cell2 wywoluj_gadka3 condition propability 0.5 endevent //0.5

event wywoluj_gadka3 multiple 1.0 cell2 gadka3 condition memcompare * * 1 endevent

event l61+l144_tlk-4_losuj multiple 0.0 none
	change1_cell2
	wywoluj_l61+l144_tlk-4
condition propability 0.5 endevent //0.5

node -1 0 l61+l144_tlk-4 sound 15731.552 261 -7250.852 l61+l144_tlk-4.wav endsound
event l61+l144_tlk-4 sound 0.0 l61+l144_tlk-4 1 endevent

event wywoluj_l61+l144_tlk-4 multiple 1.0 cell2 l61+l144_tlk-4 condition memcompare * * 1 endevent

node -1 0 cell4 memcell 0 0 0 none 0 0 none endmemcell
event change0_cell4 updatevalues 0.0 cell4 * * 0 endevent
event change1_cell4 updatevalues 0.0 cell4 * * 1 endevent

node -1 0 cell3 memcell 0 0 0 none 0 0 none endmemcell
event change0_cell3 updatevalues 0.0 cell3 * * 0 endevent
event change1_cell3 updatevalues 0.0 cell3 * * 1 endevent
event change2_cell3 updatevalues 0.0 cell3 * * 2 endevent
event change3_cell3 updatevalues 0.0 cell3 * * 3 endevent

event losuj_pawonkow_wyjazd multiple 0.0 none change1_cell4 pawonkow_zdawka1 condition propability 0.65 endevent //0.65

event pawonkow_zdawka1 multiple 2.0 cell4 Pwk_11- Pwk_14- Pwk_N_s13 condition memcompare * * 1 endevent

event losuj_pawonkow_wjazd multiple 0.0 cell3
	change1_cell3
	losuj_pawonkow_wjazd2
	losuj_pawonkow_wjazd3
	wywoluj_pawonkow_wjazd
condition memcompare * * 0 endevent

event losuj_pawonkow_wjazd2 multiple 1.0 none change2_cell3 condition propability 0.5 endevent //0.5
event losuj_pawonkow_wjazd3 multiple 2.0 none change3_cell3 condition propability 0.333 endevent //0.333

//--------------------------------------

event wywoluj_pawonkow_wjazd multiple 4.0 none pawonkow_wjazd1 pawonkow_wjazd11 endevent

event pawonkow_wjazd1 multiple 0.0 cell3 pawonkow_wjazd1.1 condition memcompare * * 1 endevent

event pawonkow_wjazd1.1 multiple 0.0 cell4
	paw_przejazd1_zamykaj
	Pwk_11+
	Pwk_14+
	Pwk_A_s2
	Pwk_M_s2
condition memcompare * * 1 endevent

event pawonkow_wjazd11 multiple 0.0 cell3 pawonkow_wjazd11.1 condition memcompare * * 1 endevent

event pawonkow_wjazd11.1 multiple 0.0 cell4 paw_przejazd1_zamykaj Pwk_A_s5 condition memcompare * * 0 endevent

//--------------------------------------

event pawonkow_wjazd2.22 multiple 0.0 none pawonkow_wjazd2 pawonkow_wjazd22 endevent

event pawonkow_wjazd2 multiple 0.0 cell3 pawonkow_wjazd2.1 condition memcompare * * 2 endevent

event pawonkow_wjazd2.1 multiple 0.0 cell4
	paw_przejazd1_zamykaj
	Pwk_11+
	Pwk_14+
	Pwk_A_s2
	Pwk_M_s2
condition memcompare * * 1 endevent

event pawonkow_wjazd22 multiple 0.0 cell3 pawonkow_wjazd22.1 condition memcompare * * 2 endevent

event pawonkow_wjazd22.1 multiple 0.0 cell4 paw_przejazd1_zamykaj Pwk_A_s5 condition memcompare * * 0 endevent

//--------------------------------------

event pawonkow_wjazd3.33 multiple 0.0 none pawonkow_wjazd3 pawonkow_wjazd33 endevent

event pawonkow_wjazd3 multiple 0.0 cell3 pawonkow_wjazd3.1 condition memcompare * * 3 endevent

node -1 0 l61+l144_tlk-5 sound 17383.352 261 -7358.617 l61+l144_tlk-5.wav endsound
event l61+l144_tlk-5 sound 0.0 l61+l144_tlk-5 1 endevent

event pawonkow_wjazd3.1 multiple 0.0 cell4 l61+l144_tlk-5 pawonkow_wjazd3.2 condition memcompare * * 1 endevent

event pawonkow_wjazd3.2 multiple 5.0 none
	paw_przejazd1_zamykaj
	Pwk_11+
	Pwk_14+
	Pwk_A_s2
	Pwk_M_s2
endevent

event pawonkow_wjazd33 multiple 0.0 cell3 pawonkow_wjazd33.1 condition memcompare * * 3 endevent

node -1 0 l61+l144_tlk-6 sound 17383.352 261 -7358.617 l61+l144_tlk-6.wav endsound
event l61+l144_tlk-6 sound 0.0 l61+l144_tlk-6 1 endevent

event pawonkow_wjazd33.1 multiple 0.0 cell4 l61+l144_tlk-6 pawonkow_wjazd33.2 condition memcompare * * 0 endevent

event pawonkow_wjazd33.2 multiple 8.0 cell4 paw_przejazd1_zamykaj Pwk_A_s5 endevent

//--------------------------------------

event pawonkow_zdawka2 multiple 0.0 cell4 Pwk_11- Pwk_14- Pwk_N_s13 condition memcompare * * 0 endevent

event paw_przejazd1:free multiple 0.0 none paw_przejazd1_otwieraj1 endevent

event paw_zdawka:free multiple 0.0 cell4 Pwk_11+ Pwk_14+ Pwk_M_s2 condition memcompare * * 0 endevent

//---------------------------------------------- Pawonków - Pludry ----------------------------------------------

event zeruj_cell multiple 0.0 none paw_a_shp_ok change0_cell2 change0_cell3 change0_cell4 endevent

//Ra 2fba: pierwsze losowanie dla Pluder, wybiera wariant 1 albo zostawia wariant 0 i wpuszcza coś od Fosowskich na bok
event losuj_pludry multiple 5 none losuj_pludry1 pludry1 endevent
event losuj_pludry1 multiple 0.0 none change1_cell2 condition propability 0.35 endevent //0.35
event pludry1 multiple 2.0 cell2 Pld_14- Pld_H_s13 condition memcompare * * 0 endevent

//Ra 2fba: uruchamia się, gdy coś z Fosowskich wjedzie na bok (wariant 0) - przestawia wariant na 2
event pludry_przelot:free multiple 0.0 cell2 change2_cell2 condition memcompare * * 0 endevent

//"przelot przez Pludry podany"
node -1 0 l61+l144_tlk-10 sound 21638.083 261 -8108.12 l61+l144_tlk-10.wav endsound
event l61+l144_tlk-10 sound 0.0 l61+l144_tlk-10 1 endevent

//Ra 2fba: w wariancie 2 coś wjechało na bok i można zrobić przelot
event pludry1.1:event1 multiple 0.0 cell2
	przejazd_pludry1_zamykaj
	Pld_14+
	Pld_A_s2
	Pld_G_s2
	l61+l144_tlk-10
	change3_cell2
condition memcompare * * 2 endevent

//"przelot przez Pludry podany"... ale że w Lublińcu był?
node -1 0 l61+l144_tlk-10.1 sound 22277 261 -8301 l61+l144_tlk-10.wav endsound
event l61+l144_tlk-10.1 sound 0.0 l61+l144_tlk-10.1 1 endevent

//Ra 2fba: tor pludry1.2 był przy Lublińcu - jeśli wariant 2, to zmieniany na 3, a przelot czeka
//Ra 2fba: był problem, bo wariant 2 może być tylko po losowaniu, albo coś z Lublińca musi wyjechać
//Ra 2fba: z Lublińca nic więcej nie wyjeżdża bo tylko Lbc_M jest odpalany
event pludry1.2:event1 multiple 0.0 cell2
	przejazd_pludry1_zamykaj
	Pld_14+
	Pld_A_s2
	Pld_G_s2
	l61+l144_tlk-10.1
	change3_cell2
condition memcompare * * 2 endevent

node -1 0 l61+l144_tlk-12 sound 25347.721 261 -9018.218 l61+l144_tlk-12.wav endsound
event l61+l144_tlk-12 sound 0.0 l61+l144_tlk-12 1 endevent

event pludry_przelot1:free multiple 0.0 cell2 Pld_1- Pld_C_s10 l61+l144_tlk-12 pludry_60 condition memcompare * * 3 endevent

//Ra 2G2G: wcześniej było Pld_2:event2, ale wtedy ostatni wagon jechał prosto...
//Ra 2G2G: teraz się uruchamia po zjechaniu z Pld_1, ale tylko za pierwszym razem (ten z przeciwka nie uruchamia drugi raz)
event Pld_Iz1:free multiple 0.0 cell2 przejazd_pludry1_free1 przejazd_pludry1_free3 changeA_cell2 condition memcompare * 0 * endevent

event przejazd_pludry1_free1 multiple 0.0 cell2 przejazd_pludry1_otwieraj1 condition memcompare * * 3 endevent

//--------------------------------------

node -1 0 l61+l144_tlk-7 sound 19601.06 261 -7453.304 l61+l144_tlk-7.wav endsound
event l61+l144_tlk-7 sound 0.0 l61+l144_tlk-7 1 endevent

event losuj_l61+l144_tlk-7 multiple 0.0 none
	losuj_l61+l144_tlk-7.1
	wywoluj_l61+l144_tlk-7
endevent

event losuj_l61+l144_tlk-7.1 multiple 1.0 none paw_a_shp_off condition propability 0.5 endevent //0.5

event wywoluj_l61+l144_tlk-7 multiple 3.0 paw_a_shp_mem l61+l144_tlk-7 condition memcompare * * 1 endevent

//--------------------------------------

//Ra 2fba: drugie losowanie dla Pluder, jeśli w pierwszym wyszło 1: zmienia komórkę 3 z 0 na 1, ewentualnie na 2
event losuj_pludry2:event1 multiple 0.0 cell2 losuj_pludry2.1 change1_cell3 condition memcompare * * 1 endevent

event losuj_pludry2.1 multiple 3 none change2_cell3 condition propability 0.5 endevent //0.5

node -1 0 l61+l144_tlk-8 sound 22957.774 261 -8514.942 l61+l144_tlk-8.wav endsound
event l61+l144_tlk-8 sound 0.0 l61+l144_tlk-8 1 endevent

//Ra 2fba: dla wariantu 1-1 wjeźdżamy na bok na S13
event pludry2.1:event1 multiple 0.0 cell3
	l61+l144_tlk-8
	przejazd_pludry1_zamykaj
	Pld_1-
	Pld_A_s13
condition memcompare * * 1 endevent

node -1 0 l61+l144_tlk-9 sound 24252.915 261 -8934.278 l61+l144_tlk-9.wav endsound
event l61+l144_tlk-9 sound 0.0 l61+l144_tlk-9 1 endevent

//Ra 2fba: dla wariantu 1-2 wjeźdżamy na bok na Sz
event pludry2.2:event1 multiple 0.0 cell3
	l61+l144_tlk-9
	przejazd_pludry1_zamykaj
	Pld_1-
	Pld_A_sz1
condition memcompare * * 2 endevent

node -1 0 l61+l144_tlk-11 sound 25496.566 261 -9039.327 l61+l144_tlk-11.wav endsound
event l61+l144_tlk-11 sound 0.0 l61+l144_tlk-11 1 endevent

event przejazd_pludry1_free3 multiple 0.0 cell2
	l61+l144_tlk-11
	Pld_1+
	Pld_H_s2
	Pld_B_s2
	pludry_60
condition memcompare * * 1 endevent

event pludry_przelot2:free multiple 0.0 cell2 przejazd_pludry1_otwieraj1 Pld_14- Pld_F_s10 condition memcompare * * 1 endevent

//---------------------------------------------- Pludry - Fosowskie ----------------------------------------------

node -1 0 cell5 memcell 0 0 0 none 0 0 none endmemcell
//event change0_cell5 updatevalues 0.0 cell5 * * 0 endevent //nie używane
event change1_cell5 updatevalues 0.0 cell5 * * 1 endevent //losowanie nieudane: wjazd EN57 z Fo_C
event change2_cell5 updatevalues 0.0 cell5 * * 2 endevent //losowanie udane: losowanie do cell7

event kibelChyzej:event1 multiple 0.0 none change1_cell5 kibel_fos_losuj kibel_fos_wywoluj endevent

event kibel_fos_losuj multiple 0.5 none change2_cell5 wjazd_opolanin_losuj4 condition propability 0.5 endevent //0.5

event kibel_fos_wywoluj multiple 2.0 cell5 Fo_1+ Fo_4bd Fo_C_s13 fosowskie_0 condition memcompare * * 1 endevent //fosowskie_0 jest z setvelocity.inc
//Ra 2G2M: trzeba EN57 dać rozkład ze stacją Fosowskie (żeby stanął przy peronie), a nie kombinować z niewidocznym semaforem

//--------------------------------------

node -1 0 cell6 memcell 0 0 0 none 0 0 none endmemcell
event change0_cell6 updatevalues 0.0 cell6 * * 0 endevent
event change1_cell6 updatevalues 0.0 cell6 * * 1 endevent
event change2_cell6 updatevalues 0.0 cell6 * * 2 endevent
event change3_cell6 updatevalues 0.0 cell6 * * 3 endevent

node -1 0 sz memcell 0 0 0 none 0 0 none endmemcell
event change1_sz updatevalues 0.0 sz * * 1 endevent

//--------------------------------------

event wjazd_opolanin_losuj1:free multiple 0.0 cell5 wjazd_opolanin_losuj2 condition memcompare * * 1 endevent
event wjazd_opolanin_losuj2 multiple 1.0 none change2_cell6 else wjazd_opolanin_losuj3 condition propability 0.333 endevent //0.5
event wjazd_opolanin_losuj3 multiple 2.0 none change3_cell6 else change1_cell6 condition propability 0.5 endevent //0.333

event fos1.1:busy multiple 0.0 cell5 fos1.2_0 condition memcompare * * 1 endevent
node -1 0 l61+l144_tlk-13 sound 29222.663 261 -9334.642 l61+l144_tlk-13.wav endsound //Fo: "proszę powiedzieć, podam zastępczy"
event l61+l144_tlk-13 sound 0.0 l61+l144_tlk-13 1 endevent
event fos1.2_0 multiple 10 cell6 fos1.2_0 else fos1.2 condition memcompare * * 0 endevent //Ra 2G2Q: zapętliłem dla =0, bo dopiero EN57 losuje >0
event fos1.2 multiple 0.0 cell6 l61+l144_tlk-13 change1_sz condition memcompare * * 1 endevent

node -1 0 l61+l144_tlk-14 sound 32192.825 261 -9763.415 l61+l144_tlk-14.wav endsound //Fo: "można świecić; podany"
event l61+l144_tlk-14 sound 0.0 l61+l144_tlk-14 1 endevent
event fos1.3:busy multiple 0.0 none fos1.3_0 endevent
event fos1.3_0 multiple 10 cell6 fos1.3_0 else fos1.3_sz condition memcompare * * 0 endevent //Ra 2G2Q: zapętliłem dla =0, bo dopiero EN57 losuje >0 w cell6
event fos1.3_sz multiple 5 sz l61+l144_tlk-14 fos1.4 condition memcompare * * 1 endevent
event fos1.4 multiple 1.0 none
	przejazd1fos_zamykaj
	Fo_23-
	Fo_22-
	Fo_H4_s10
	Fo_7-
	Fo_5bd
	Fo_3-
	fos1.5
endevent
event fos1.5 multiple 0.0 none Fo_2- Fo_4bd Fo_D_sz1 endevent

event fos_przejazd2:free multiple 0.0 none przejazd2fos_otwieraj1 endevent

event fos1.6:busy multiple 0.0 cell5 fos1.7_0 condition memcompare * * 1 endevent
event fos1.7_0 multiple 10 cell6 fos1.7_0 else fos1.7 condition memcompare * * 0 endevent //Ra 2G2Q: zapętliłem dla =0, bo dopiero EN57 losuje >0
event fos1.7 multiple 0 cell6 fos1.8 condition memcompare * * 2 endevent
event fos1.8 multiple 0.0 none
	przejazd1fos_zamykaj
	Fo_23-
	Fo_22-
	Fo_7-
	Fo_5bd
	Fo_3-
	Fo_2-
	fos1.9
endevent
event fos1.9 multiple 3 none Fo_H4_s10 Fo_D_s12 endevent

event fos1.10:busy multiple 0.0 cell5 fos1.11_0 condition memcompare * * 1 endevent
node -1 0 l61+l144_tlk-16 sound 28434.494 261 -9281.668 l61+l144_tlk-16.wav endsound //Fo: "wjazd podany, wyjazd jak zwolni się"
event l61+l144_tlk-16 sound 0.0 l61+l144_tlk-16 1 endevent
event fos1.11_0 multiple 10 cell6 fos1.11_0 else fos1.11 condition memcompare * * 0 endevent //Ra 2G2Q: zapętliłem dla =0, bo dopiero EN57 losuje >0
event fos1.11 multiple 0.0 cell6
	Fo_7-
	Fo_5bd
	Fo_3-
	Fo_2-
	Fo_D_s13
	l61+l144_tlk-16
condition memcompare * * 3 endevent

event fos1.12:busy multiple 0.0 cell6
	przejazd1fos_zamykaj
	Fo_23-
	Fo_22-
	Fo_H4_s10
condition memcompare * * 3 endevent

//--------------------------------------

node -1 0 cell7 memcell 0 0 0 none 0 0 none endmemcell
event change0_cell7 updatevalues 0.0 cell7 * * 0 endevent
event change1_cell7 updatevalues 0.0 cell7 * * 1 endevent
event change2_cell7 updatevalues 0.0 cell7 * * 2 endevent
event change3_cell7 updatevalues 0.0 cell7 * * 3 endevent

node -1 0 sz1 memcell 0 0 0 none 0 0 none endmemcell
event change1_sz1 updatevalues 0.0 sz1 * * 1 endevent

//--------------------------------------

event wjazd_opolanin_losuj4 multiple 3.0 cell5 change1_cell7 wjazd_opolanin_losuj5 wjazd_opolanin_losuj6 condition memcompare * * 2 endevent
event wjazd_opolanin_losuj5 multiple 1.0 none change2_cell7 condition propability 0.5 endevent //0.5
event wjazd_opolanin_losuj6 multiple 2.0 none change3_cell7 condition propability 0.333 endevent //0.333

event fos2.1:busy multiple 0.0 cell5 fos2.2 condition memcompare * * 2 endevent
node -1 0 l61+l144_tlk-13.1 sound 28336.79 261 -9274.109 l61+l144_tlk-13.wav endsound //Fo: "proszę powiedzieć, podam zastępczy"
event l61+l144_tlk-13.1 sound 0.0 l61+l144_tlk-13.1 1 endevent
event fos2.2 multiple 0.0 cell7 l61+l144_tlk-13.1 change1_sz1 condition memcompare * * 1 endevent

node -1 0 l61+l144_tlk-14.1 sound 32244.954 261 -9777.067 l61+l144_tlk-14.wav endsound //Fo: "można świecić; podany"
event l61+l144_tlk-14.1 sound 0.0 l61+l144_tlk-14.1 1 endevent

event fos2.3:busy multiple 0.0 sz1 l61+l144_tlk-14.1 fos2.4 condition memcompare * * 1 endevent

event fos2.4 multiple 5.0 none
	przejazd1fos_zamykaj
	Fo_H1_s2
	Fo_ISpH1_sp2
	Fo_2-
	Fo_4bd
	Fo_D_sz1
endevent

event fos2.5:busy multiple 0.0 cell5 fos2.6 condition memcompare * * 2 endevent

event fos2.6 multiple 0.0 cell7 fos2.7 condition memcompare * * 2 endevent
event fos2.7 multiple 0.0 none przejazd1fos_zamykaj Fo_H1_s2 Fo_2- Fo_4bd Fo_D_s10a endevent
//event Fo_D_s10a multiple 0.0 none Fo_D_sem_ligh10 Fo_D_sem_lighs2 Fo_ToD_os4 endevent //Ra 2G2J: przeniesione do semafora

node -1 0 l61+l144_tlk-16.1 sound 27653.196 261 -9216.27 l61+l144_tlk-16.wav endsound //Fo: "wjazd podany, wyjazd jak zwolni się"
event l61+l144_tlk-16.1 sound 0.0 l61+l144_tlk-16.1 1 endevent

event fos2.8:busy multiple 0.0 cell5 fos2.9 condition memcompare * * 2 endevent
event fos2.9 multiple 0.0 cell7 Fo_2- Fo_4bd Fo_D_s13a l61+l144_tlk-16.1 condition memcompare * * 3 endevent

event fos2.10:busy multiple 0.0 cell5 fos2.11 condition memcompare * * 2 endevent
event fos2.11 multiple 0.0 cell7 przejazd1fos_zamykaj Fo_H1_s2 Fo_ISpH1_sp2 condition memcompare * * 3 endevent

event fos_przejazd1:free multiple 0.0 none przejazd1fos_otwieraj1 endevent

//---------------------------------------------- Fosowskie - Ozimek ----------------------------------------------

node -1 0 l61+l144_tlk-17 sound 34032.58 261 -9474.8 l61+l144_tlk-17.wav endsound //pogaduchy
event l61+l144_tlk-17 sound 0.0 l61+l144_tlk-17 1 endevent

event l61+l144_tlk-17:busy multiple 0.0 none l61+l144_tlk-17 endevent

//--------------------------------------

node -1 0 przejazd_cell1 memcell 0 0 0 none 0 0 none endmemcell

event change1_przejazd_cell1 updatevalues 0.0 przejazd_cell1 * * 1 endevent

node -1 0 przejazd_cell2 memcell 0 0 0 none 0 0 none endmemcell

event change1_przejazd_cell2 updatevalues 0.0 przejazd_cell2 * * 1 endevent

//--------------------------------------

event losuj_fos_oz1:busy multiple 0.0 none losuj_przejazd_fos_oz1 losuj_przejazd_fos_oz2 endevent

event losuj_przejazd_fos_oz1 multiple 0.0 none change1_przejazd_cell1 przejazd474_zamykaj condition propability 0.9 endevent //0.9

event losuj_przejazd_fos_oz2 multiple 0.0 none change1_przejazd_cell2 przejazd476_zamykaj condition propability 0.9 endevent //0.9

event topka_fos_oz1:busy multiple 0.0 none topka1 topka2 topka3 topka4 endevent

event fos_ozim1_sem_ligh2_tlk lights 0.0 fos_ozim1 1 1 0 0 endevent

event topka1 multiple 0.0 przejazd_cell1 topka11 condition memcompare * * 1 endevent
event topka11 multiple 0.0 przejazd_cell2 fos_ozim1_sem_ligh2_tlk condition memcompare * * 1 endevent

event topka2 multiple 0.0 przejazd_cell1 topka22 condition memcompare * * 1 endevent
event topka22 multiple 0.0 przejazd_cell2 fos_ozim1-osp1 condition memcompare * * 0 endevent

event topka3 multiple 0.0 przejazd_cell1 topka33 condition memcompare * * 0 endevent
event topka33 multiple 0.0 przejazd_cell2 fos_ozim1-osp1 condition memcompare * * 1 endevent

event topka4 multiple 0.0 przejazd_cell1 topka44 condition memcompare * * 0 endevent
event topka44 multiple 0.0 przejazd_cell2 fos_ozim1-osp1 condition memcompare * * 0 endevent

//--------------------------------------

event tor2233:free multiple 0.0 none przejazd474_otwieraj1 endevent

event oz_tor33:free multiple 0.0 none przejazd476_otwieraj1 endevent

event losuj_l61+l144_tlk-18:busy multiple 0.0 none paw_a_shp_off condition propability 0.5 endevent //0.5

node -1 0 l61+l144_tlk-18 sound 37628.402 261 -11866.55 l61+l144_tlk-18.wav endsound
event l61+l144_tlk-18 sound 0.0 l61+l144_tlk-18 1 endevent

event l61+l144_tlk-18:busy multiple 0.0 paw_a_shp_mem l61+l144_tlk-18 condition memcompare * * 1 endevent

event losuj_fos_oz3:busy multiple 0.0 none przejazd524_zamykaj change1_cell2 condition propability 0.9 endevent //0.9

event fos_ozim3_on:busy multiple 0.0 none fos_ozim3on1 fos_ozim3on2 endevent

event fos_ozim3on1 multiple 0.0 cell2 fos_ozim3-osp1 condition memcompare * * 0 endevent

event fos_ozim3_sem_ligh2_tlk lights 0.0 fos_ozim3 1 1 0 0 endevent

event fos_ozim3on2 multiple 0.0 cell2 fos_ozim3_sem_ligh2_tlk condition memcompare * * 1 endevent

event fos_ozim3_off:busy multiple 0.0 none fos_ozim3_off endevent

event kr_tor1:free multiple 0.0 none przejazd524_otwieraj1 endevent

event fos_oz4:busy multiple 0.0 none przejazd541_zamykaj endevent

event oz_tor1:free multiple 0.0 none przejazd541_otwieraj1 endevent

//--------------------------------------

event ozimek_wjazd_losuj:busy multiple 0.0 none change1_cell3 condition propability 0.5 endevent //0.5

event ozimek_wjazd1:busy multiple 0.0 cell3 Ok_A_S5 condition memcompare * * 0 endevent

node -1 0 l61+l144_tlk-15 sound 13448.15 261 41405.208 l61+l144_tlk-15.wav endsound
event l61+l144_tlk-15 sound 0.0 l61+l144_tlk-15 1 endevent

event ozimek_wjazd2:busy multiple 0.0 cell3 l61+l144_tlk-15 Ok_A_Sz1 condition memcompare * * 1 endevent

//---------------------------------------------- Koniec ----------------------------------------------