Page 1 of 1

control flow in subscript

Posted: Sat Oct 23, 2010 1:01 am
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.

Posted: Sat Oct 23, 2010 7:39 am
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]

Posted: Sat Oct 23, 2010 10:35 am
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...

Posted: Sun Oct 24, 2010 6:00 am
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.

Posted: Mon Oct 25, 2010 10:01 am
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.

Posted: Mon Oct 25, 2010 8:25 pm
by yusuke
Dear Bob
Your ManageBatch.mdl is helpful.
I understand using of Lookup to control next order.

Thank you very much.