I am using the following code in the agent chart at Final State to display agent movement within the system.
System.out.println("I came in at " + TimeIn + " and exited at " +TimeOut + " and spent " + TimeInSystem + " seconds in the system");
The output displayed within the console when I run the model.
I would like to display the output in the main window. I have seen example where collection is used to display output information regarding agent progress. It was not straightforward. Is it possible to explain to me how can I display output in a text in main for accumulative agents?
Thanks
just use a text element you can find in the presentation palette, initially empty
and every time you want to print you can do
text.setText(text.getText()+"I came in at " + TimeIn + " and exited at " +TimeOut + " and spent " + TimeInSystem + " seconds in the system\n");
Related
I would like to customise the indentation and presentation of the in-built scalatest methods Given, When, Then, And, and info.
At the moment a test report looks like:
Blah should
do a test
+ Given a
+ And b
+ When c
+ Then d
+ And e
+ Given f
+ Then g
Similarly in the html output.
I want to, as a first step, optionally indent these reports so it looks like:
Blah should
do a test
+ Given a
+ And b
+ When c
+ Then d
+ And e
+ Given f
+ Then g
I can easily put the spaces after the +, but this (a) looks terrible and (b) doesn't translate to html reports.
Does anyone know a way? The only info I am finding online is to write an entire reporter from scratch, both for console + html output
I want to take a time snapshot of agent population within system with all the parameter. Is there a way to export this data into excel or csv. Basically I want to validate few calculations manually.
Simplest solution, drag the text file object from the connectivity pallet to your model. Change it to write, create a new text file and link it to the file you created.
Then have some button, event or function and you simply add the following type of code:
for (MyAgent myAgent:myAgentPopulation) {
file.println(
myAgent.name + "\t" +
myAgent.age + "\t"
myAgent.gender + "\t"
myAgent.work + "\t"
);
}
the "\t" is for creating a tab separated file, you can use ""` for comma separated CSV
Hello i need help for my Excel automation using autohotkey..
So I just want to check if current cell value is " Beef Jerky", then goto LabelA. , if current cell value is empty ( " " ), then goto LabelB.
it's simple but i couldnt figure it out yet on how to write in in line of autohotkey code, can somebody help me with this? Thankyou very much
So I learned how to run a ps1 file from kotlin here, but the only purpose I have for that file is to run the commands, then delete itself. Is there any way to remove the hassle of creating a file that later will just be deleted?
I have a one lined string of commands, each separated by a semicolon.
Edit
Some people asked for the powershell code, here it is:
(I split it into lines, but really it's just one line)
The dollar signs without backslashes in front of them are references to variables in kotlin.
"\$ComObj = New-Object -ComObject WScript.Shell; " +
"\$ShortCut = \$ComObj.CreateShortcut(\"\$Env:${shortcut.absolutePath}\"); " +
"\$ShortCut.TargetPath = \"%windir%\\system32\\cmd.exe\"; " +
"\$ShortCut.Description = \"${f.nameWithoutExtension}\"; " +
"\$ShortCut.Arguments = \"/c \"\"start $url\"\"\"; " +
"\$ShortCut.FullName; \$ShortCut.WindowStyle = 7; " +
"\$ShortCut.IconLocation = \"$iconpath\"; " +
"\$ShortCut.Save(); " +
"Remove-Item \"${createPs.absolutePath}\"; "
(The code is written to a file before being run, something that I dont want)
If you can put your script in a variable and the variable will expand upon calling PowerShell you could do it this way
Runtime.getRuntime().exec("powershell.exe -command '\$yourvariable'")
Of course you'll need to experiment with the right escape chars to get quotes around the command you want to run.
I've had the most success with this type of thing by first running it in CMD.exe and figuring out the proper syntax. Then take it to your program. That way you'll know you get the PowerShell syntax down correctly first. From what I understand parsing for PowerShell is all done after the engine starts up. So when you call PowerShell in this manner you have to get the syntax just right.
I want to format a numeric value to two decimal points (it is an integer variable)
I am using following expression (as used to use in vb6) but it is not working. Please advise how to fix it.
="Total Drawings Rs. " & format(Parameters!TotalDrawings.Value,"###########.00")"
Thanks
Furqan
You use .net format string, not VB6/VBA
= "Total Drawings Rs. " + Format(CDbl(Parameters!TotalDrawings.Value), "##########0.00")
Edit: fixed concat + trailing " + CDbl