ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
=======================================================================
================================


*         Chapter 9
*         Question no. 9-1

          Generate 5,0

Bak       Advance 4,3
          Transfer .1,Acc,Rej

Acc       Terminate 1

Rej       Advance 15,3
          Transfer ,Bak

          Start 1000

=======================================================================
==============_


*         Chapter 9
*         Question no 9-2

          Generate 6,0

          Transfer .1 A,B

A         Advance 4,2
          Transfer .1,AccA,Rej

AccA      Terminate 1

Rej       Terminate 0

B         Advance 20,10
          Transfer .1,AccB,Rej

AccB      Terminate 0

          Start 1000

_____=============

*         Chapter 9
*         Question no. 9-3

          Generate 5,2
Queue 1
          Enter clk
          Depart 1
          Advance 8,4
          leave clk

          Mark
          Queue 2
          Seize 2
          Depart 2
          Advance 4,3
          Release 2
          Tabulate Tab
          Terminate 1

clk       Storage 2

Tab       Table M1,5,5,10

          Start 1000

_____=============

*         Chapter 9
*         Question no. 9-4

          Generate 3,2

          Advance 15,5
          Transfer .2,GalB,GalC

GalB      Advance 30,10
          Transfer .1,Tab,GalD

GalC      Advance 20,10

GalD      Advance 15,5
          Tabulate Name

Tab       Terminate 1


Name      Table m1,3,5,10

          Start 1000

_____=============

*         Chapter 9
*         Question no. 9-5

          Generate 10,5
Acc       Transfer Both,,Busy
          Seize 1
          Advance 6,3
          Release 1
          Terminate 1

Busy      Transfer .5,Callf,Lefty

Callf     Advance 5,0
          Transfer ,Acc

Lefty     Queue 1
          Terminate 0

          Start 1000

_____=============

*         Chapter 9
*         Question No. 9-6

          Generate 10,5

          Transfer .2,Hot,Sand

Hot       Queue 1
          Enter Ser
          Depart 1
          Advance 1,0
          Leave Ser
          Queue 2
          Enter Caf
          Depart 2
          Advance 30,10
          Leave Caf
          Transfer ,Lef

Sand      Queue 3
          Seize SWSer
          Depart 3
          Advance 0.5,0
          Release SWSer
          Queue 2
          Enter Caf
          Depart 2
          Advance 15,10
          Leave Caf

Lef       Tabulate Tab
          Terminate 1

Ser       Storage 6
Caf       Storage 200
Tab       Table M1,5,5,10

          Start 1000

_____=============

*         Chapter 9
*         Question no. 9-7

          Generate 1,.5

          Queue Wait1
          Enter Berth
          Depart Wait1
          Queue Wait2
          Enter Crane
          Depart Wait2
          Advance 7.5,3
          Leave Crane
          Transfer .1,Term,Stay

Term      Leave Berth
          Terminate 1

Stay      Queue QFuel
          Seize Fuel
          Depart QFuel
          Advance 1,.5
          Release Fuel

          Transfer,Term

Berth     Storage 6
Crane     Storage 5

          Start 100

_____=============

*         Chapter 10
*         Question No. 10-1


          Buy Function RN1,D4
          0.1,4/0.3,3/0.5,2/1,1

          Generate 20,10
          Queue 1
          Seize C
          Depart 1
          Assign 1,FN$Buy
          Advance V$T
          Release C
          Tabulate Tab
Terminate 100

 T        Variable (P1#5)
 Tab      Table M1,5,5,10

          Start 100

_____=============

*         Chapter 10
*         Question No 10-2

Customer Function RN1,C24
0.0,0.0/0.1,0.104/0.2,0.222/0.3,0.355/0.4,0.509/0.5,0.69
0.6,0.915/0.7,1.2/0.75,1.38/0.8,1.6/0.8,1.6/0.84,1.83/0.88,2.12
0.9,2.3/0.92,2.52/0.94,2.81/0.95,2.99/0.96,3.2/0.97,3.5
0.98,3.9/0.99,4.6/0.995,5.3/0.998,6.2/0.999,8

          Generate 36,FN$Customer
          Transfer BOTH,,Bna

          Enter Basket
          Assign 1,0
          Assign 2,FN$Buy
          Savevalue 10_,S$Basket
          Advance FN$People
          Queue Wait
          Enter Ctr
          Depart Wait
          Advance V$Tm
          Leave Ctr
          Savevalue 10-,S$Basket
          Tabulate Tab
          Tabulate Item
          Leave Basket
          Terminate 1

Bna       Transfer .1,Lev
          Assign 1,1
          Assign 2,FN$Buy
          Savevalue 10_,P1
          Advance FN$People
          Queue Wait
          Enter Ctr
          Depart Wait
          Advance V$Tm
          Leave Ctr
          Savevalue 10-,P1

          Tabulate Tab
          Tabulate Item
          Terminate 1

Lev       Terminate 0
Ctr       Storage 5
Basket    Storage 50

Tab       Table M1,5,5,10
Item      Table P2,5,5,4

Tm        Variable (P2#10_25)


Buy       Function RN1,D4
.2,5/.5,10/.9,15/1,20

People    Function X10,C5
0,0/15,400/30,900/45,1500/60,2250


          Start 10,NP
          Reset
          Start 1000




_____=============

*         Chapter 10
*         Question No. 10-3

          Generate 15,5
          Gate NU B,ClrkC

 ClrkA    Queue 1
          Seize A
          Depart 1
          Advance 10,3
          Release A

 ClrkB    Queue 2
          Seize B
          Depart 2
          Advance 5,2
          Release B
          Terminate 1

 ClrkC    Queue 3
          Seize C
          Depart 3
          Advance 5,2
          Release C
          Terminate 1

          Start 1000
_____=============

*         Chapter 10
*         Question No. 10-4

          Generate 300,60
          Logic S B
          Gate LR B
          Terminate 1

          Generate 20,15
          Enter BQ
          Gate LS B
          Advance 5
          Savevalue BT_,5
          Leave BQ
          Test NE X$BT,20,Lev
          Savevalue BT,20

Lev       Logic R B
          Terminate 0

BQ        Storage 10
Bd        Variable S$BQ#5

         Start 10




_____=============

*         Chapter 10
*         Question No. 10-5

Destination Function RN1,D4
 0.2,1/0.5,2/0.85,3/1,4

 Sz10 Function P2,D10
10,1/20,2/30,3/40,4/50,5/60,6/70,7/80,8/90,9/100,10

 Sz5 Function P2,D20
05,1/10,2/15,3/20,4/25,5/30,6/35,7/40,8/45,9/50,10
55,11/60,12/65,13/70,14/75,15/80,16/85,17/90,18
95,19/100,20

          Generate 7,3
          Assign 1,FN$Destination
          Assign 2,V$Size

          Gate LR Main
          Logic S Main
          Advance FN$Sz10
Logic R Main

          Test E P1,1,Ln2

 Ln1      Queue LQ1
          Seize L1
          Depart LQ1
          Advance FN$Sz5
          Release L1
          Terminate 1

 Ln2      Test E P1,2,Ln3
          Queue LQ2
          Seize L2
          Depart LQ2
          Advance FN$Sz5
          Release L2
          Terminate 1

 Ln3      Test E P1,3,Ln4
          Queue LQ3
          Seize L3
          Depart LQ3
          Advance FN$Sz5
          Release L3
          Terminate 1

 Ln4      Seize L4
          Advance FN$Sz5
          Release L4
          Terminate 1


Size      Variable 90#RN1_10

          Start 1000




_____=============

*         Chapter 10
*         Question No. 10-6

Phone Function RN1,C24
0.0,0.0/0.1,0.104/0.2,0.222/0.3,0.355/0.4,0.509/0.5,0.69/0.6,0.915/0.7,
1.2/0.75,1.38
0.8,1.6/0.84,1.83/0.88,2.12/0.9,2.3/0.92,2.52/0.94,2.81/0.95,2.99/0.96,
3.2/0.97,3.5
0.98,3.9/0.99,4.6/0.995,5.3/0.998,6.2/0.999,7/0.9997,8

          Generate 12,FN$Phone
          Test G V$FREE,2,Abnd
Asn1     Assign 1,V$LINE
          Gate LR P1,Asn1

 Asn2     Assign 2,V$LINE
          Test NE P1,P2,Asn2
          Logic S P1
          Transfer Both,,Block

 GetL     Enter Links
          Gate LR P2,Busy
          Logic S P2
          Advance 120,FN$Phone
          Logic R P1
          Logic R P2
          Leave Links

          Transfer .8,,Local
          Savevalue Profit_,1
          Transfer ,Term
 Local    Savevalue Profit_,0.1
 Term     Terminate 1


 Abnd     Terminate 0

 Block    Logic R P1
          Terminate 0

 Busy     Leave Links
          Logic R P1
          Terminate 0


 Links    Storage    10

 Line     Variable 50#RN1/1000_1
 Free     Variable 50-2#S$Links-2


          Start 1000




_____=============

*         Chapter 10
*         Question No. 10-7

          Generate 10,5
          Queue 1
          Seize SingleTrack
          Depart 1
          Advance 8,4
          Release SingleTrack
Logic I Path
          Gate LS Path,Track2

Track1    Advance 18,9
          Terminate 1

Track2    ADVANCE 18,9
          TERMINATE 1

          Start 1000




_____=============




_____=============

More Related Content

Simulation programs

  • 1. ======================================================================= ================================ * Chapter 9 * Question no. 9-1 Generate 5,0 Bak Advance 4,3 Transfer .1,Acc,Rej Acc Terminate 1 Rej Advance 15,3 Transfer ,Bak Start 1000 ======================================================================= ==============_ * Chapter 9 * Question no 9-2 Generate 6,0 Transfer .1 A,B A Advance 4,2 Transfer .1,AccA,Rej AccA Terminate 1 Rej Terminate 0 B Advance 20,10 Transfer .1,AccB,Rej AccB Terminate 0 Start 1000 _____============= * Chapter 9 * Question no. 9-3 Generate 5,2
  • 2. Queue 1 Enter clk Depart 1 Advance 8,4 leave clk Mark Queue 2 Seize 2 Depart 2 Advance 4,3 Release 2 Tabulate Tab Terminate 1 clk Storage 2 Tab Table M1,5,5,10 Start 1000 _____============= * Chapter 9 * Question no. 9-4 Generate 3,2 Advance 15,5 Transfer .2,GalB,GalC GalB Advance 30,10 Transfer .1,Tab,GalD GalC Advance 20,10 GalD Advance 15,5 Tabulate Name Tab Terminate 1 Name Table m1,3,5,10 Start 1000 _____============= * Chapter 9 * Question no. 9-5 Generate 10,5
  • 3. Acc Transfer Both,,Busy Seize 1 Advance 6,3 Release 1 Terminate 1 Busy Transfer .5,Callf,Lefty Callf Advance 5,0 Transfer ,Acc Lefty Queue 1 Terminate 0 Start 1000 _____============= * Chapter 9 * Question No. 9-6 Generate 10,5 Transfer .2,Hot,Sand Hot Queue 1 Enter Ser Depart 1 Advance 1,0 Leave Ser Queue 2 Enter Caf Depart 2 Advance 30,10 Leave Caf Transfer ,Lef Sand Queue 3 Seize SWSer Depart 3 Advance 0.5,0 Release SWSer Queue 2 Enter Caf Depart 2 Advance 15,10 Leave Caf Lef Tabulate Tab Terminate 1 Ser Storage 6 Caf Storage 200
  • 4. Tab Table M1,5,5,10 Start 1000 _____============= * Chapter 9 * Question no. 9-7 Generate 1,.5 Queue Wait1 Enter Berth Depart Wait1 Queue Wait2 Enter Crane Depart Wait2 Advance 7.5,3 Leave Crane Transfer .1,Term,Stay Term Leave Berth Terminate 1 Stay Queue QFuel Seize Fuel Depart QFuel Advance 1,.5 Release Fuel Transfer,Term Berth Storage 6 Crane Storage 5 Start 100 _____============= * Chapter 10 * Question No. 10-1 Buy Function RN1,D4 0.1,4/0.3,3/0.5,2/1,1 Generate 20,10 Queue 1 Seize C Depart 1 Assign 1,FN$Buy Advance V$T Release C Tabulate Tab
  • 5. Terminate 100 T Variable (P1#5) Tab Table M1,5,5,10 Start 100 _____============= * Chapter 10 * Question No 10-2 Customer Function RN1,C24 0.0,0.0/0.1,0.104/0.2,0.222/0.3,0.355/0.4,0.509/0.5,0.69 0.6,0.915/0.7,1.2/0.75,1.38/0.8,1.6/0.8,1.6/0.84,1.83/0.88,2.12 0.9,2.3/0.92,2.52/0.94,2.81/0.95,2.99/0.96,3.2/0.97,3.5 0.98,3.9/0.99,4.6/0.995,5.3/0.998,6.2/0.999,8 Generate 36,FN$Customer Transfer BOTH,,Bna Enter Basket Assign 1,0 Assign 2,FN$Buy Savevalue 10_,S$Basket Advance FN$People Queue Wait Enter Ctr Depart Wait Advance V$Tm Leave Ctr Savevalue 10-,S$Basket Tabulate Tab Tabulate Item Leave Basket Terminate 1 Bna Transfer .1,Lev Assign 1,1 Assign 2,FN$Buy Savevalue 10_,P1 Advance FN$People Queue Wait Enter Ctr Depart Wait Advance V$Tm Leave Ctr Savevalue 10-,P1 Tabulate Tab Tabulate Item Terminate 1 Lev Terminate 0
  • 6. Ctr Storage 5 Basket Storage 50 Tab Table M1,5,5,10 Item Table P2,5,5,4 Tm Variable (P2#10_25) Buy Function RN1,D4 .2,5/.5,10/.9,15/1,20 People Function X10,C5 0,0/15,400/30,900/45,1500/60,2250 Start 10,NP Reset Start 1000 _____============= * Chapter 10 * Question No. 10-3 Generate 15,5 Gate NU B,ClrkC ClrkA Queue 1 Seize A Depart 1 Advance 10,3 Release A ClrkB Queue 2 Seize B Depart 2 Advance 5,2 Release B Terminate 1 ClrkC Queue 3 Seize C Depart 3 Advance 5,2 Release C Terminate 1 Start 1000
  • 7. _____============= * Chapter 10 * Question No. 10-4 Generate 300,60 Logic S B Gate LR B Terminate 1 Generate 20,15 Enter BQ Gate LS B Advance 5 Savevalue BT_,5 Leave BQ Test NE X$BT,20,Lev Savevalue BT,20 Lev Logic R B Terminate 0 BQ Storage 10 Bd Variable S$BQ#5 Start 10 _____============= * Chapter 10 * Question No. 10-5 Destination Function RN1,D4 0.2,1/0.5,2/0.85,3/1,4 Sz10 Function P2,D10 10,1/20,2/30,3/40,4/50,5/60,6/70,7/80,8/90,9/100,10 Sz5 Function P2,D20 05,1/10,2/15,3/20,4/25,5/30,6/35,7/40,8/45,9/50,10 55,11/60,12/65,13/70,14/75,15/80,16/85,17/90,18 95,19/100,20 Generate 7,3 Assign 1,FN$Destination Assign 2,V$Size Gate LR Main Logic S Main Advance FN$Sz10
  • 8. Logic R Main Test E P1,1,Ln2 Ln1 Queue LQ1 Seize L1 Depart LQ1 Advance FN$Sz5 Release L1 Terminate 1 Ln2 Test E P1,2,Ln3 Queue LQ2 Seize L2 Depart LQ2 Advance FN$Sz5 Release L2 Terminate 1 Ln3 Test E P1,3,Ln4 Queue LQ3 Seize L3 Depart LQ3 Advance FN$Sz5 Release L3 Terminate 1 Ln4 Seize L4 Advance FN$Sz5 Release L4 Terminate 1 Size Variable 90#RN1_10 Start 1000 _____============= * Chapter 10 * Question No. 10-6 Phone Function RN1,C24 0.0,0.0/0.1,0.104/0.2,0.222/0.3,0.355/0.4,0.509/0.5,0.69/0.6,0.915/0.7, 1.2/0.75,1.38 0.8,1.6/0.84,1.83/0.88,2.12/0.9,2.3/0.92,2.52/0.94,2.81/0.95,2.99/0.96, 3.2/0.97,3.5 0.98,3.9/0.99,4.6/0.995,5.3/0.998,6.2/0.999,7/0.9997,8 Generate 12,FN$Phone Test G V$FREE,2,Abnd
  • 9. Asn1 Assign 1,V$LINE Gate LR P1,Asn1 Asn2 Assign 2,V$LINE Test NE P1,P2,Asn2 Logic S P1 Transfer Both,,Block GetL Enter Links Gate LR P2,Busy Logic S P2 Advance 120,FN$Phone Logic R P1 Logic R P2 Leave Links Transfer .8,,Local Savevalue Profit_,1 Transfer ,Term Local Savevalue Profit_,0.1 Term Terminate 1 Abnd Terminate 0 Block Logic R P1 Terminate 0 Busy Leave Links Logic R P1 Terminate 0 Links Storage 10 Line Variable 50#RN1/1000_1 Free Variable 50-2#S$Links-2 Start 1000 _____============= * Chapter 10 * Question No. 10-7 Generate 10,5 Queue 1 Seize SingleTrack Depart 1 Advance 8,4 Release SingleTrack
  • 10. Logic I Path Gate LS Path,Track2 Track1 Advance 18,9 Terminate 1 Track2 ADVANCE 18,9 TERMINATE 1 Start 1000 _____============= _____=============