Jump to content

Solving a multiple event issue


Empfohlene Beiträge

Good morning all

I have a situation of multiple events under the following scenario. A ferry docks, the port crane unloads containers, some to vehicles some to the quay. So far no problems. After the vehicles have returned to the ferry to unload the containers from the trailers to the quay I then have multiple events highlighted. The operation still works OK but I am then adding further to this problem by creating another operation for the same crane to reload the containers from the quayside back on board the ferry. It would seem that at this point the crane doesn't know where to place the container once it has been uplifted simply returning it back to the quayside pad. The cargo pads on the ship have completely different names to those on the quayside.

Clearly the multiple events issue is to do with the instruction to the crane at the point when the EV chooses when the event will be triggered, (crane finishes lifting/lowering) but I am not clear how this can be remedied. Has anyone any suggestion please.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Pete,

As always difficult to answer with so few information.  But I only give some things I get stuck in the past.

2 hours ago, 220hotwheels said:

the multiple events issue is to do with the instruction to the crane at the point when the EV chooses when the event will be triggered, (crane finishes lifting/lowering)

When I worked with containers, to figure out how the crane works, there was always a problem when trying to give more than one instruction to the crane in "crane finish lifting/lowering" .  
Is it not possible to change that and get the same result ? I.e. 1 container handling when the  event triggers "crane finish lifting/lowering" ?

Kind regards, hopefully you come to a solution.
Herman

* I do not think you have the other common problem I found in old programs on the forum. The event that triggers (crane finishes lifting/lowering) has to be the only code in EV or LUA for that crane.

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 3 Stunden schrieb 220hotwheels:

The cargo pads on the ship have completely different names to those on the quayside.

Hello Pete,

the pads on the ship, on lorries and on the quay all have individual addesses (even when the names are the same)

When your crane moves to the wrong address, your skript is giving the crane this wrong address.
Look for a flaw in your skript.   (I can't, because I don't see it.)

Greets
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Herman and Goetz

Many thanks for your replies. Since posting my question I have continued to try to solve my dilemma looking both at the addresses for each element as well as working through the overall EV. I couldn't find any problems with the addresses for each of the cargo pads but came to the conclusion that I was perhaps trying too hard to make the operation more simplistic by having more commands in the EV than perhaps I need. The crane operation was in 6 parts. 1)unloading from ship to truck one and partly to quayside, 2)unloading to 2nd truck and balance to quayside. Next crane operation was 1)to unload container from 1st truck to quayside, then from 2nd truck to quayside. Final crane operation was to load all containers back onto the ferry.

I am now working through resetting the EV so that there is only one operation to fulfil the disembarking operation and one to fulfil the embarkation element. This is not yet completed but thus far I have managed to remove the multiple events element. If it works I will come back and let you both know. If it doesn't then you might hear a very loud expletive emanating from the U.K.

Once again many thanks for your advice. If I continue to struggle then I'll see what I can muster up in the way of screenshots to try to show my continued problem more clearly.

Pete 

Link zu diesem Kommentar
Auf anderen Seiten teilen

I'm not sure if this will help, but I have lots of object variables on my cranes, that store things like, whether it is getting a container or placing a container, whether it is loading a vehicle or unloading a vehicle, the target container and the target pad/vehicle. There's a list that holds the wagons of the train that gets loaded by an iteration when the train arrives, and the wagons/trucks and the pads all have local variables that hold the containers they have on them...

Mind you it's not working properly and I've not had the energy to look at it for the past few days. I'm pretty sure I know why it's not working, I'm just not sure how to fix it. For some reason the crane will occasionally pick up an empty pad and put it on the back of a truck!

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Simon

It sounds as though we both have a similar dilemma, almost there but not quite.  Your approach would seem to be very much more sophisticated than mine, I'm still getting into variables and iteration at a snails pace so my list of instructions for each operation get longer and longer which means that I have rather a lot of procedures running through my head and trying hard to ensure that they all operate in sequence. Touch wood, so far since beginning my revamp this morning I think I am almost there. Just a few more containers to enter into the EV and then see if everything works. The unloading bit did along with the disembarkation of all vehicles so I hope the same can be said for the embarkation element later.

It just goes to show that the age old adage of a problem shared etc etc. Having spent a few hours last night pondering on how to solve this problem it was only after posting my cry for help this morning that a solution appeared. One day my ability to streamline my EV might just make everything much simpler. In the meantime I'll simply continue to create a mountain of instructions following Murphy's Law.

Many thanks for your reply. I hope you get your niggles sorted soon.

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

A general tip, which may be superfluous, but here it is anyway...

It sometimes helps, before starting on coding, to get a big enough sheet of paper and draw out a synopsis of what is supposed to happen. It doesn't have to be too formal (although there are formal tools for this sort of stuff...); just a clear, linear, account of each step, with its potential branches, conditions etc. Not too technical, either; plain language is best. This usually helps to show up any hidden loops, dead-ends, extraneous commands and more, and can serve as a basis for coding in whatever System language is concerned.
I spent several decades as analyst/programmer, and tried (and often succeeded...) to have my code pretty self-explanatory, with clear comments at every step, and clear variable types and names. It was often helpful, just the same, to have this 'overview' on hand for reference.
Just a thought; hope this helps. B|

Ein allgemeiner Tipp, der vielleicht überflüssig ist, aber hier ist er trotzdem...

Manchmal hilft es, vor dem Programmieren ein ausreichend großes Blatt Papier zu besorgen und eine Zusammenfassung dessen zu erstellen, was passieren soll. Es muss nicht zu formell sein (obwohl es formale Werkzeuge für diese Art von Dingen gibt...); nur eine klare, lineare Darstellung jedes Schrittes mit seinen möglichen Verzweigungen, Bedingungen usw. Auch nicht zu technisch; Klare Sprache ist am besten. Dies hilft normalerweise, versteckte Schleifen, Sackgassen, überflüssige Befehle und mehr aufzuzeigen, und kann als Grundlage für die Codierung in jeder Systemsprache dienen.
Ich verbrachte mehrere Jahrzehnte als Analyst/Programmierer und versuchte (und war oft erfolgreich...) meinen Code ziemlich selbsterklärend zu gestalten, mit klaren Kommentaren bei jedem Schritt und klaren Variablentypen und -namen. Trotzdem war es oft hilfreich, diese „Übersicht“ als Referenz zur Hand zu haben.
Nur ein Gedanke; hoffe das hilft. B|

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi

All advice is most helpful and very welcomed I therefore thank you for yours, which I must say carries much logical weight along with pure and simple common sense. Generally speaking I do start off with a basic plan on paper before I embark on EV work but then once started enthusiasm gets the better of me and off I go on different tangents. Having owned and run my own Freight Forwarding and haulage company for many years along with other businesses I do have a pretty good grasp on what I need to achieve to get this element of my layout functioning properly. That's the theory. Where I fall down is the lack of know how to put my ideas into efficient practice in my EV. However practice makes perfect and making mistakes is the best way to learn. The answer stays with you longer that way. 

Thus far I have established that within my EV I have a clear conflict between the disembarkation side and the embarkation element which is confusing the crane no end so back to basics. I have deactivated all of the embarkation EV for the containers and will concentrate on making sure that the disembarkation part runs perfectly first before looking more closely at the rest of the process.

 As the saying goes "watch this space"

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi to Goetz, Herman, Simon and Dad3353

You each very kindly offered assistance with my multi event issue, which is now to a large extent sorted. It has taken me several days, many different attempts and a fare amount of alcoholic beverages to get to the present stage of operation. However I do still have a rather annoying aspect that my knowledge thus far just won't allow me to solve through EV.

Whilst I still need to streamline some of the overall operation the basic one of unloading the containers from the ferry to either trucks or to the quayside is working perfectly. In reverse the containers are unloaded from either the trucks, after they return, or from the quayside back onto the ferry. However the only way that I can get this to work correctly is by manually deactivating the 'loading' EV instruction so that the unloading works fine and visa versa. If I don't do this then the crane is clearly confused as to just what it should do at any given point and decides to throw a tantrum, picking up, dropping off or simply leaving containers in mid air before deciding to go back to sleep and reset itself. I've tried talking nicely to the crane, I've called it names and promised to remove it from my layout but all to no avail.

No doubt elements like variables, iterations and the like will probably hold the key unless of course there is a way of including in the EV an instruction to either turn off or on the activation for each particular part of the program but my knowledge of the former and my search through elements of the EV haven't as yet shone any light on my problem so if any of you can point me in the right direction I would be most grateful. I have attached three screen shots which I hope might provide some clue as to where I am going wrong.

Pete

Screenshot 2021-06-20 20.30.25.jpg

Screenshot 2021-06-20 20.30.38..jpg

Screenshot 2021-06-20 20.30.48.jpg

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...