23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.6 Practical Use <strong>of</strong> Concepts 47<br />

wake?wakeup(Id)<br />

pihs!schedule(PIKeeperId,InitialPosition)<br />

pihp?free(PIKeeperId)<br />

pihp!store(PIKeeperId,PI)<br />

initial method call "Name <strong>of</strong> the instance method called after process instantiation."<br />

loopForever<br />

instance methods "List <strong>of</strong> method definitions."<br />

loopForever<br />

acceptProduct;<br />

storeProductInfo;<br />

scheduleServices;<br />

waitTilNextProductArrivalIsSafe;<br />

loopForever<br />

"Enter new product information and physical product."<br />

"Fill a free Product Info Keeper with the accepted PI."<br />

"Notify scheduler <strong>of</strong> product entrance and initial position."<br />

"Arrange a wake up for a new arrival based<br />

on the appropriate packet distance."<br />

acceptProduct<br />

i?accept(productInfo); "Accept next product information."<br />

piti?productArrived; "Wait until corresponding mailing product arrives."<br />

piti?currentPosition(initialPosition) "Read the initial position <strong>of</strong> the arrived<br />

product."<br />

storeProductInfo<br />

pihp?free(piKeeperId); "Read identifier <strong>of</strong> free Product Info Keeper."<br />

pihp!store<br />

"Store product info in free Product Info Keeper."<br />

(piKeeperId,productInfo)<br />

scheduleServices<br />

pihs!schedule<br />

(piKeeperId,initialPosition)<br />

waitTilNextProductArrivalIsSafe<br />

id : ProductInputHandlerId<br />

wake!wakeAt(initialPosition<br />

+productDistance,myId);<br />

wake?wakeup(id ¡ id = myId)<br />

"Send schedule message to Service Scheduler."<br />

"Ask Transporter Image to get woken when<br />

the previous product has been transported<br />

over a productDistance <strong>of</strong> distance."<br />

(For a proper understanding <strong>of</strong> this thesis it is not necessary to read the following<br />

explanation <strong>of</strong> this example. The example gives an impression <strong>of</strong> the POOSL language.)<br />

Explanation:<br />

The POOSL description consists <strong>of</strong> the definition <strong>of</strong> the instance variables, and the<br />

communication channels <strong>of</strong> the class. The message interface gives a list <strong>of</strong> all possible<br />

messages on all channels <strong>of</strong> the class. The initial method call gives the name <strong>of</strong><br />

the instance method that is executed when an object starts performing behaviour<br />

for the first time. An instance method is a sort <strong>of</strong> procedure. Methods can call<br />

each other or themselves recursively so that infinite loops can be created that<br />

model infinite behaviour. The keyword instance methods announces the list <strong>of</strong><br />

method definitions. In this case there are five methods: loopForever, acceptProduct,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!