question

Damodaran Moturu G avatar image
0 Likes"
Damodaran Moturu G asked Damodaran Moturu G commented

Is it possible to change the maximum capacity of the processor dynamically?

FlexSim 17.2.4
processormaximum capacity
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Joerg Vogel avatar image
3 Likes"
Joerg Vogel answered Damodaran Moturu G commented

The capacity is a variable in the attribute branch of the object tree.

The variable name is "maxcontent".

model().find("Processor1").as(Object).attrs.variables.subnodes["maxcontent"].value = 4;

or non dot syntax

setvarnum(model().find("Processor1"),"maxcontent",4);
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

A long command line is shortened by splitting into functional parts:

Object proc1 = model().find("Processor1");
proc1.attrs.variables.subnodes["maxcontent"].value = 4;

"current" is the reference of the Processor1 in its triggers

current.attrs.variables.subnodes["maxcontent"].value = 4;
3 Likes 3 ·
Damodaran Moturu G avatar image Damodaran Moturu G Joerg Vogel commented ·

Thanks so much for attending to my questions. Exactly what i was looking for. Worked perfectly for me.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

when increasing the capacity of an already full processor you'll want to call receiveitem on the processor to immediately take a new item to process.

Example model with a user command setProcessCapacity attached. setprocessorcapacity.fsm

3 Likes 3 ·
Damodaran Moturu G avatar image Damodaran Moturu G commented ·

@jason.lightfoot Wow... exactly what i was looking for... Thanks a million for attending to my question.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.