Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 2.20
by AndrewAMD. 11/15/19 03:34
What are you working on?
by jumpman. 11/14/19 16:17
A9
by preacherX. 11/14/19 15:28
Idx calculated every tick
by jcl. 11/14/19 15:25
IG plugin initial release
by Dalla. 11/13/19 19:07
Login 0 IG ..
by Dalla. 11/13/19 19:03
Moving Average crossover
by gra9. 11/13/19 10:43
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
6 registered members (Iglarion, kvm, AndrewAMD, Dooley, 3run, 1 invisible), 675 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LaszloK, gra9, Dev_ill, Ryu, andrews825
18329 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
get optimized parameter values #476239
02/06/19 18:34
02/06/19 18:34
Joined: Nov 2018
Posts: 50
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 50
Is there any way to export the results of the parameter optimization (i.e. the data that is saved in the .par files) while the script is running, for example after the last StepCycle has been completed?


I know this can also be done by just reading the .par files after the entire testing is complete, but it would be more convenient to have these exported directly. And also I am just curious on how the optimize function actually works.

Last edited by gamadeus; 02/06/19 18:45.
Re: get optimized parameter values [Re: gamadeus] #478550
11/06/19 13:23
11/06/19 13:23
Joined: Nov 2019
Posts: 3
N
NiklasH Offline
Guest
NiklasH  Offline
Guest
N

Joined: Nov 2019
Posts: 3
Did you find an answer to this one?
Does anybody know how to access the optimized parameters from within the objective() function?

Re: get optimized parameter values [Re: gamadeus] #478551
11/06/19 16:29
11/06/19 16:29
Joined: Jul 2000
Posts: 27,053
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,053
Frankfurt
No, because you need objective() for calculating them.

Re: get optimized parameter values [Re: jcl] #478554
11/07/19 09:54
11/07/19 09:54
Joined: Nov 2019
Posts: 3
N
NiklasH Offline
Guest
NiklasH  Offline
Guest
N

Joined: Nov 2019
Posts: 3
The objective function returns the objective value *after* parameter optimizations, no?

I'm doing genetic optimization and I want to get not only the finally selected parameters.
How would I go about logging all parameter combinations which fulfill certain criteria, preferably to a file in CSV format, if possible?

Edit: Would it work, if I did it inside a
Code
 if(is(EXITRUN)) {}
?

Last edited by NiklasH; 11/07/19 10:30.
Re: get optimized parameter values [Re: NiklasH] #478555
11/07/19 12:01
11/07/19 12:01
Joined: Feb 2017
Posts: 789
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 789
Chicago
Originally Posted by NiklasH
The objective function returns the objective value *after* parameter optimizations, no?
Not correct. It returns each individual iteration's objective measure. Zorro then evaluates all objective() returns after all objective() calls are complete.

Re: get optimized parameter values [Re: AndrewAMD] #478556
11/07/19 12:21
11/07/19 12:21
Joined: Nov 2019
Posts: 3
N
NiklasH Offline
Guest
NiklasH  Offline
Guest
N

Joined: Nov 2019
Posts: 3
and each individiual iteration will contain a set of values used for the optimize-able vars, right?

Perhaps I'm just bad at explaining what I mean.

If i have some code like this in my run() function:

Code
...
  var p1 = optimize(1,1,10,1);
  var p2 = optimize(1,1,10,1);
  var p3 = optimize(1,1,10,1);
...


Any time the objective() function is called, p1, p2 and p3 will contain *some* value that was used in the evaluated iteration (otherwise, how would the objective be evaluated?).
Now my question is, whether I can get (and log) the assigned values of p1, p2 and p3 inside the objective() function, or perhaps there is a better way?

Last edited by NiklasH; 11/07/19 12:37.
Re: get optimized parameter values [Re: gamadeus] #478559
11/08/19 14:24
11/08/19 14:24
Joined: Jul 2000
Posts: 27,053
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,053
Frankfurt
If you set a variable in function A and want to get it in function B, use global variables.

https://manual.zorro-project.com/aarray.htm


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1