control flow in subscript

Use this forum to post Vensim related questions.
Post Reply
yusuke
Member
Posts: 46
Joined: Sun Apr 27, 2008 11:41 pm

control flow in subscript

Post by yusuke »

Hello,
I making a model using subscript(sub1,sub2,sub3) stock and flow.
I want to control this flow using switch, like ID(1,2,3).
It's meaning that if ID=1, sub1 is active.

So, I want to control this model using like ID(1,3,2,1,,,,).
But the timing of switch is not fixed.
Because I want to change this switch after the finishing of active flow(variable span).
So I can't use import data like under.
time ID
0 1
1 3
2 2
3 1

If there are some hint or sample model.
Please help me.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

I don't really follow what you are trying to do here.

Can you post a sample model with some of the structure you are trying to model?

Tony.

[Edited on 23-10-2010 by Administrator]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I can' really follow your question either but an answer that might apply would be

value based on id = VECTOR ELM MAP(subbed value[s1],ID-1)

where

sub : s1,s2,s3...
yusuke
Member
Posts: 46
Joined: Sun Apr 27, 2008 11:41 pm

Post by yusuke »

Dear tony

I attached my model.
It is using "DELAY BATCH" which has three task.
Active task is only one. And when its task finish,
next task can be active.
To decide active task , I use random function.
I know it is not a sophisticated one.

I want to know the way,
how to set active task order.
like
taskorder =task1,task3,task2,task1

Dear bob, I will read VECTOR ELM MAP help.
Thank you.
Attachments
submanagebatch.mdl
(3.38 KiB) Downloaded 190 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I can't make much sense of the rest of your model - you should do units checking to help straighten things out. DELAY BATCH should take a rate as the input and return a rate as the output.

But here is one way to schedule different tasks in a specific order - the order entered into a Lookup in this case. There are other ways, for example entering a vector of starts and using VECTOR ELM MAP.
Attachments
ManagedBatch.mdl
(2.82 KiB) Downloaded 192 times
yusuke
Member
Posts: 46
Joined: Sun Apr 27, 2008 11:41 pm

Post by yusuke »

Dear Bob
Your ManageBatch.mdl is helpful.
I understand using of Lookup to control next order.

Thank you very much.
Post Reply