Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, SBGuy, Petra, flink, 1 invisible), 699 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enable printf in Train mode #451027
04/27/15 14:53
04/27/15 14:53
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
In Train mode all printf statements, even the ones directed at the Log or Diag file, are suppressed.
I have a Crash that only happens during Train mode. How can I debug it?

Re: enable printf in Train mode [Re: GPEngine] #451031
04/27/15 15:26
04/27/15 15:26
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
For example The crash occurs in-between opt cycles
Diag has

Exit Loop TA-Lib Series
Parameter 4 step 7: 11.44 => 0.90 1634/1927
StepCycle: 7
Quit

The Quit represents a crash during the time Zorro was trying to get a reading for Step 8. It hasn't begun executing Step 8 yet. I know this because there the INITRUN sends an RPC.

Re: enable printf in Train mode [Re: GPEngine] #451038
04/27/15 16:23
04/27/15 16:23
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi GPEngine. I suspect based on his comment in another thread jcl will recommend that you write debugging info to another file...

HTH.

Re: enable printf in Train mode [Re: DdlV] #451043
04/27/15 17:28
04/27/15 17:28
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
You could do a print(TO_DIAG,...) - that should work also in training mode.

Re: enable printf in Train mode [Re: jcl] #451055
04/28/15 02:54
04/28/15 02:54
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
That's useful.
Perhaps it could adopt printf's features so I can easily print numeric values

Re: enable printf in Train mode [Re: GPEngine] #451056
04/28/15 03:10
04/28/15 03:10
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
What do these lines mean in diag?
Asset EUR/GBP status EUR/GBP:L 32686008 1
Asset EUR/GBP status EUR/GBP:S 32686008 1

What does the 32686008 mean

Re: enable printf in Train mode [Re: GPEngine] #451057
04/28/15 05:16
04/28/15 05:16
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
...And my problem was I was using a var as a loop boundary and assuming it would be treated as an int.

optimize only produces floats. So I had

var num_clusters = (optimize(10., 3., 25., -20));

Then, later, I used
int i
for (i = 0; i < num_clusters; i++) {
read_one_element_of_something_with_exactly_num_cluster_elements();
}

I expected num_clusters to be rounded down to nearest int. I don't know why I expected that. So when num_clusters=1.1, the for loop is executed 2x, leading to one more read than is possible. So, it crashed.

I guess, better to use
int num_clusters = (int)(optimize(10., 3., 25., -20));
when really needing an int.

Re: enable printf in Train mode [Re: GPEngine] #451061
04/28/15 08:54
04/28/15 08:54
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
GPEngine, good point! I was finding the same issue. Force casting on optimisation parameter coud be a solution. I'll give it a try.

Thank You

Re: enable printf in Train mode [Re: MatPed] #451076
04/28/15 11:35
04/28/15 11:35
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Yes, cast it to int before comparison. When you have an int and a float in a C expression and no cast operator, the int is converted to float, not the float to int. - The Diag numbers look like a status flag, but I don't know exactly what they mean.

Re: enable printf in Train mode [Re: jcl] #451276
05/01/15 10:48
05/01/15 10:48
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
FYI, the next update will contain a "TO_FILE" print target that can also print messages during the training process.


Moderated by  Petra 

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