Jump to content

Release a resource after fixed time.


Recommended Posts

Hi


I am trying to model a process with Server seizing a resource for fixed amount of time then releasing it before the Sever processing is over. I tried using a timer with TimeInState as an interval time to check period the resource has been busy then trigger an event after fixed time to release the resource .This has not been working and I am getting an error massage . Could any body suggest away to do this ?


Thanks


Malseiari

Link to comment
Share on other sites

A very basic solution is to use a simple add-on process to your server. Create an expression property (in the definitions tab) called something like “FixedResourceTime” and give it the appropriate time units. Then, on your server, create an add-on process for “Processing”. This add-on process will be a simple seize-delay-release, with the delay step using the “FixedResourceTime” property.


Some considerations: what happens if the fixed time is greater than the processing time? Is this behavior on more than one server instance? If so, consider sub-classing the server to build the behavior internally and to allow for more general use.


Also, advice on the forums will be much more helpful if you can include a model with the behavior, or at least describe the error in more detail :)


-Adam

Link to comment
Share on other sites

I tried the solution suggested by Adam, however using a Delay in the processing made the processing of server pause until the delay is over and the resource released then continued processing. I want to release the resource after fixed time without pausing the server.


The server seizes the resource once the entity is processing .


I tried using timer with timer event to release the resource after fixed time, I am getting this message once I run the model.


Thanks


Malseiari

Windows_7.jpg.5eaf659002be0be20caf961a933ae064.jpg

Link to comment
Share on other sites

A quick work-around is to set the add-on process to consist of a single execute step, with Execute -> Advanced Options -> Token Wait Action set to None (Continue). Have that Execute step execute the same seize-delay-release process from my first comment, and you should be able to get concurrent seizing of both the secondary resource and the server during processing.


With your approach, it seems like the seize process is at the model level, meaning that the model object is attempting to seize (and release) the resource, rather than the server or the entity. The error message indicates that the release step is trying to release a quantity (1) of resource, but it doesn’t have any quantity of that resource seized. You could try running the model with the trace window open to determine how the model is behaving (i.e. what is trying to seize what, and when).


-Adam

process_example.thumb.png.9c2160508df4cc46a8ddc20062cf13d2.png

Link to comment
Share on other sites

I tried the solution suggested by Adam, however using a Delay in the processing made the processing of server pause until the delay is over and the resource released then continued processing. I want to release the resource after fixed time without pausing the server.


The server seizes the resource once the entity is processing .


I tried using timer with timer event to release the resource after fixed time, I am getting this message once I run the model.


Thanks


Malseiari

 

delay step Works just as you told if you did not set ("somehow") its interruptible property to true. I think you should see interruptible Operator simbit for your solution.

Link to comment
Share on other sites

×
×
  • Create New...