Hello.
Thank you for always supporting .
My simulation is timestep "week" and for two years.
I want a month information when a signal is generated.
This signal is discrete.
I try
(1)
Making a custom table.
But table size is large, 4week/month*12*2year=98
and discrete data can't use time "by" .
Many unnecessary things are displayed in table.
(2)
MESSAGE function
To read help .
But MESSAGE value shoud literal surrounded by single quotes or a String variable.
So, i cant set 'get month' message.
I expected to display the message function show a dialog
when the signal was sent.
Are there alternatives?
or correct funciton?
How to show or get a discrete data
How to show or get a discrete data
- Attachments
-
- weekyear.mdl
- (1.88 KiB) Downloaded 312 times
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
I really don't understand what you are trying to achieve. If the model is in weeks you can define a variable
month = INTEGER(Time/weeks per month)
or
month = INTEGER(Time/weeks per month + 0.5)
depending on how you want to round.
Then to capture the month something happens you would use
month last signal received = SAMPLE IF TRUE(signal > 0,month,-100)
I hope that is helpful. As I say I can't really understand what you want to achieve.
month = INTEGER(Time/weeks per month)
or
month = INTEGER(Time/weeks per month + 0.5)
depending on how you want to round.
Then to capture the month something happens you would use
month last signal received = SAMPLE IF TRUE(signal > 0,month,-100)
I hope that is helpful. As I say I can't really understand what you want to achieve.
Thank you Bob.
I'm sorry the explanation ..bad... .
Your approach is the completely true.
But I want to show only when the signal >0
" SAMPLE IF TRUE(signal > 0,month,-100)"
Vensim store data base in timestep. I know.
(1)Can I show table data only signal >0
"basic show" " I want to show"
signal month signal month
0 -100 1 3
0 -100 1 4
1 3 1 8
(2)Or , can I get information dialog whith message?
I want to know how to use MESSAGE function.
Help show MESSAGE('msg',display)
'msg' shoud be string.
Can I use variable data "month" in 'msg' ?
Thank you for your help.
I'm sorry the explanation ..bad... .
Your approach is the completely true.
But I want to show only when the signal >0
" SAMPLE IF TRUE(signal > 0,month,-100)"
Vensim store data base in timestep. I know.
(1)Can I show table data only signal >0
"basic show" " I want to show"
signal month signal month
0 -100 1 3
0 -100 1 4
1 3 1 8
(2)Or , can I get information dialog whith message?
I want to know how to use MESSAGE function.
Help show MESSAGE('msg',display)
'msg' shoud be string.
Can I use variable data "month" in 'msg' ?
Thank you for your help.
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm