epcornelisse 0 Posted January 7, 2016 Share Posted January 7, 2016 Hi, If I want to sent entities from a date time table to a specific node depending on the timenow, what is the best way of modeling this? e.g. i have the following data; Time node 7-1-2016 0:00:00 A 7-1-2016 2:00:00 B 7-1-2016 5:00:00 C Thanks Link to post Share on other sites
gocken 42 Posted January 7, 2016 Share Posted January 7, 2016 Insert a new data table named "TableArrivals" (from data tab). Then, insert a "Date Time" column named "ScheduledArrivals" from the standart property drop down. Fill it with some data (i.e., you provided in the post). In "Source" object (from which you want your entities to be created) set "Arrival Mode" property as "TableArrivals" and "Arrival Time Property" as "TableArrivals.ScheduledArrivals". Next define a "Node" object reference from "Data" tab into "TableArrivals" table and name it "WhichNode". Specify which node to send according to "SchduledArrivals" column. Then select output node of "Source" object. Set its "Entity Destination Type" property to "Specific". And, "Node Name" Property to "TableArrivals.WhichNode". A small example is uploaded. small example.spfx Link to post Share on other sites
epcornelisse 0 Posted January 7, 2016 Author Share Posted January 7, 2016 Hi gocken, Thanks for the quick reaction. Unfortunately I already have defined an arrival table in my model, sorry I forgot to mention that. This Arrival table uses different times for entity arrivals than times it must travel to via certain node. So i think I'm looking for a solution in a add-on process which searches trough the table and sends the entity to that node at the correct time interval. any ideas? Link to post Share on other sites
dsturrock 33 Posted January 7, 2016 Share Posted January 7, 2016 I'm not sure how you intend to determine which row in the table corresponds to a particular entity, but once you do that it sounds like your process would be simply: Delay: Math.Max(0, MyTable.DepartureTime-TimeNow) SetNode: MyTable.DestinationNode If it is one to one, then you could add these columns to your existing arrivals table. Then you would let the entity proceed normally until the point at which you want it to wait, execute the above process, then let it flow through a TransferNode. Link to post Share on other sites
gocken 42 Posted January 7, 2016 Share Posted January 7, 2016 It is hard to understand the problem without seeing the model itself. Still, small example_revised illustrates what Dave told above. hope it works... small example_revised.spfx Link to post Share on other sites
epcornelisse 0 Posted January 9, 2016 Author Share Posted January 9, 2016 Thanks for your help! However a delay wasn't what I had in mind. I used a backward search on a separate table, which seems to works. I added an example. Maybe a little off topic but do you happen to know if there is an expression for a maximum of a value? I want to now the maximum of the sum of different entity-types that are in the model at a certain time. Thanks Again! Example_with_search.spfx Link to post Share on other sites
gocken 42 Posted January 9, 2016 Share Posted January 9, 2016 "ModelEntity1.Population.NumberInSystem" gives total number of active (created, not disposed and can be somewhere else in the model) entities in the model. Note: I do not know the details of your logic but why the second entity goes to sink2? Do you allow intentionally. If not you should fix it? For example, delete the path from node x to sink2, this time the second arriving entity will go to sink 3. This can be a problem in terms of output statistics. Link to post Share on other sites
epcornelisse 0 Posted January 11, 2016 Author Share Posted January 11, 2016 Thanks, My model is working now. Do you happen to know if it is possible to turn the 'report statistics' off for all objects of a certain type? My model has a lot of paths and runs quite slow because of it. If I right click on a path and open the spreadsheet I cant select them all to uncheck the report statistics box. Link to post Share on other sites
gocken 42 Posted January 11, 2016 Share Posted January 11, 2016 In the "Results" tab see "Object Name" category. Hover your mouse around right to the triangular sign you will see a funnel appearing. from there deselect what you do not want to be reported. Link to post Share on other sites
Recommended Posts