2

It is my first time doing a Petri net, and I want to model a washing machine. I have started and it looks like this so far:

Do you have any corrections or help? I obviously know its not correct, but I am a beginner and not aware of the mistakes you guys might see. Thanks in advance.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • 1
    Well, Petri net has nothing to do with UML. In UML you'd use a state machine diagram instead. So please remove the UML tag as it's irrelevant here. – Ister Nov 27 '16 at 12:09
  • @Ister I know, I am fully aware and quite comfortable with UML, but petri nets seem to be really unpopular here and I thought it would gather more attention this way. Im sorry I know its bad – Christian Paul Nov 27 '16 at 13:03
  • nothing to do with programming, nor UML – Plamen G Nov 27 '16 at 13:32
  • 1
    @Ister Petri nets are at the base of UML activity diagrams – Christophe Nov 27 '16 at 14:12
  • 1
    @PlamenPetrov Petri nets may be used as inputs for some code generators. The [ePNK](http://www2.imm.dtu.dk/~ekki/projects/ePNK/index.shtml) is one such example. As such I do think questions on Petri nets are relevant to programming. – Pétur Ingi Egilsson Nov 27 '16 at 14:37
  • @Pétur electricity is also a critical input in order to do any programming, as is breathing, but my personal opinion is that that the scope of Stack overflow is quite a bit narrower than that. But never mind, your remark is on point. If the community allows posts like these, let them be :) – Plamen G Nov 27 '16 at 15:09
  • It is possible to consider the graphics used in UML as views of Petri Net elements. It is also possible to organize computer programs as annotations of Petri Net elements. Thus Petri Nets might interest someone interested in UML or programming. – John Frederick Chionglo Feb 14 '17 at 07:18

3 Answers3

1

First comments on your net's way of working:

  • there is no arrow back to the off state. So once you switch on your washing machine, won't you never be able to switch it off again ?
  • drain and dry both conduct back to idle. But when idle has a token, it will either go to delicate or to T1. The conditions ("program" chosen by the operator) don't vanish, so they would be triggered again and again.

Considering the last point, I'd suggest to have a different idle for the end of the program to avoid this cycling. If you have to pass several times through the same state but take different actions depending on the progress, you have to work with more tokens.

Some remarks about the net's form:

  • you don't need to put the 1 on every arc. You could make this more readable by Leaving the 1 out and indicating a number on an arc, only when more than one tokens would be needed.
  • usually, the transitions are not aligned with the arcs (although nothing forbids is) but rather perpendicular to the flow (here, horizontal)
  • In principle, "places" (nodes) represent states or resources, and "transitions" (rectangles) represent an event that changes the state (or an action that consumes resources). Your naming convention should better reflect this
Christophe
  • 68,716
  • 7
  • 72
  • 138
  • The 1 on every arc is probably from the tool being used. PIPE started doing that with version 3.0, that's why I kept using version 2.5. – Roland Weber Nov 20 '19 at 21:52
0

Apparently you're missing some condition to stop the process. Now once you start your washing will continue in an endless loop.

Ister
  • 5,958
  • 17
  • 26
  • Thanks, yes you are right, I will add an arrow with a condition to fix this. Do you see any other fundamentally wrong things? – Christian Paul Nov 27 '16 at 13:04
0

I think it would be nice to leave the transition graphics unshaded or unfilled if it is not enabled. Personally I fill it green if it is enabled.

If you want someone to check if you modeled a logic properly in your Petri Net then it would be nice if you include a description of your system logic in prose.