This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Solving a theme Park problem using FSP  RSS feed

 
Diane McKeaveney
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have this project to do on a log flume ride - i have developed the FSP required for parts 1 and 2 but for the 3rd part i need to implement a ticket machine and i have no idea how to do this - the FSP i have come with is as follows i would appreciate any help on this - also i need to put the FSP below into a java monitor so any help with that also would be cool
const M=4
set Bold={bold[1..2]}
set Meek={meek[1..2]}
set RIDERS={Bold,Meek}
PASSENGER=(enterLog->exitLog->PASSENGER).
CONTROL=ENTER[0],
ENTER[i:0..M]= (when (i<2) enterLog->ENTER[i+1]
| when (i==2) ride->EXIT[2]),
EXIT[j:0..M]=(when (j>0) exitLog->EXIT[j-1]
|when(j==0) clean->ENTER[0]).

LOG=(ride->clean->LOG).
||RIDE=(LOG||RIDERS ASSENGER||RIDERS::CONTROL)
/{ride/{bold, meek}[1..2].ride,clean/{bold,meek}[1..2].clean}.
progress Bold={bold[1..2].enterLog}
progress Meek={meek[1..2].enterLog}
||UNFAIR = (RIDE) >> {meek[1..2].enterLog}.
This is the unfair model as the bold passengers have greater priority so i need to implement the ticket machine
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link may help.
Ticket Machine
I'm not sure what is meant by FSP. Ok Finite State Processes. In which case the link won't help with threads.
[ December 14, 2003: Message edited by: HS Thomas ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!