MT version archive. - page 6

 
Alexey Viktorov:

But according to this piece of code

The value returned from this function must be processed somehow. What good will it do to return "minus many nines" if there is no reaction to it in the rest of the code?

Return minus large value will place this pass to the bottom of results. If there was no test at all (the test was stopped, in my case at opening of the first bar), then there is nothing to calculate, there is no data to calculate. Therefore, when tester_stop is set, a large negative number is returned.

In addition, I do not use this result anywhere in the code, although, perhaps, it can be used, but how - at the moment I do not know and I do not need it.

 
Сергей Таболин:

The return minus a large value will place this pass at the bottom of the results. If there was no test in principle (the test was stopped, in my case at the opening of the first bar), then there is nothing to calculate, there is no data to calculate. Therefore, when tester_stop is set, a large negative number is returned.

In addition, I do not use this result anywhere in my code, although it can probably be used but I do not know how, and I do not need it at present.

This is a very bad approach to solving tasks in general and especially to solving programming tasks.

For some reason I don't believe in tests in general and even less in optimization. That's why I can't give you specific advice on how to arrange the algorithm, but I see that your algorithm of sequencing and processing results is broken.

If before calling TesterStop() must be at least one pass, so please provide this one pass. What is your problem? That I don't know and don't need to? That is not right.

 
Сергей Таболин:

I understand everything and I don't need crutches. And I had to look for a crutch here read for what.

It's possible. But I don't remember anyone complaining about it.

Your wishes can be arranged in a much simpler way without any useless code.

Instead of INIT_PARAMETERS_INCORRECT return, weigh some global variable, say ExtTesterStop=true.

Put check on the first line of OnTick

void OnTick()
  {
   if(ExtTesterStop)
     {
      TesterStop();
      return;
     }
...
 
Alexey Viktorov:

This is a very bad approach to problem solving in general and especially for programming problems.

For some reason I don't believe in tests in general, and in optimization even less. Therefore I cannot give specific advice on the organization of the algorithm, but I see that your algorithm of sequence and processing of results is broken.

If there must be at least one pass before calling TesterStop(), provide this one pass. What is your problem? That I don't know and don't need it? That is not right.

Alexey, no offense, but you completely failed to understand why I used TesterStop(). Moreover, you didn't even try to do it. Since you haven't read what I used it for, I'll briefly explain.

I use it to sift out useless passes of testing and speed up optimization. Especially genetic optimization. That's why I don't need even one pass at all in this situation! It was replacement ofINIT_PARAMETERS_INCORRECT, for in case of their great amount in OnInit() it resulted in crash of genetics.

To believe or not to believe, to use or not to use optimization is your own business which has no relation to the solution of this problem ))))

Slava:

Your wishes can be arranged much easier without coding unnecessary frills. You'll agree that it's the same rake in a different way)))

Instead of INIT_PARAMETERS_INCORRECT return, weigh some global variable, say ExtTesterStop=true

Put check on the first line of OnTick

I agree that the code will look a bit simpler, though!

The matter still remains the same. The cancellation of the pass at the initialization stage doesn't happen. The same code will be in OnInit() and OnTick(). What do we gain?

TesterStop() will still frown

TesterStop() called on 0% of testing interval

and, in this version of MT, control will be passed to OnTester() anyway. You'll agree that we have the same problems, but in a different way ))))

It would be great if there were an alternative function, for example, TesterStopImmediately(). For cases when we must stop the test immediately passing control not into OnTester() but directly into OnDeinit(const int reason)...

But we probably won't see it in our lifetime...

 
Сергей Таболин:

Alexey, no offence, but you completely failed to understand what I used TesterStop() for. Moreover, you didn't even try to do it. Since you haven't read what I used it for, I'll briefly explain.

I use it to sift out useless passes of testing and speed up optimization. Especially genetic optimization. That's why I don't need even one pass at all in this situation! It was replacement ofINIT_PARAMETERS_INCORRECT, for in case of their great amount in OnInit() it resulted in crash of genetics.

To believe or not to believe, to use or not to use optimization - this is your own business, which has no relation to this problem)))

I didn't express myself accurately and you misunderstood me completely. But it does not matter.

 
Alexey Viktorov:

I didn't express myself precisely and you misunderstood me completely. But it does not matter.

Important. I believe that all problems in general are the result of misunderstandings. But man was born with the language in order to talk, negotiate )))) Naturally, everyone thinks they are right, but stubbornness on this issue is a sign of ... stupidity. So please explain what you mean. Personally I am ready to learn)))

 
Сергей Таболин:

Important. I believe that all problems in general are the result of misunderstandings. But man was born with the language in order to speak, to negotiate )))) Naturally, everyone thinks they are right, but stubbornness on this issue is a sign of ... stupidity. So please explain what you mean. Personally I am ready to learn ))))

What can we learn from a person who shows signs of ineptitude? Or are you talking about yourself? It's you who are stubborn and don't want to do the minimum code to try to understand what you want. Well, I've already said that I'm not involved in optimization and therefore I've never used tester-related events. My recommendations were aimed only at a narrower field. Slava repeated my recommendation. Perhaps you've used it in a different way since you don't get what you expect. It's only a guess from lack of information on the subject.

 
Alexey Viktorov:

What can we learn from a person with signs of being unintelligent? Or are you talking about yourself? You're the one who's stalling and won't do the minimum code to try to figure out what you want. Well, I've already said that I'm not engaged in optimization, so I've never used events relating to the tester. My recommendations were aimed only at a narrower field. Slava repeated my recommendation. Perhaps you've used it in a different way since you don't get what you expect. It's only a guess from lack of information on the subject.

Do you even read what I write to you?

"Alexey, no offence, but you completely failed to understand what I used TesterStop() for. Moreover, you didn't even try to do it. Since you haven't read what I used it for, I'll briefly explain.

I use it to sift out useless passes of testing andspeed up optimization. Especially genetic optimization. That's why I don't need even one pass at all in this situation! It was replacement of INIT_PARAMETERS_INCORRECT, because when their quantity in OnInit() was large, it led to crashing of genetics..."

What part of this you don't understand?

P.S. By the way, unlike you, Slava knows exactly what we're talking about. ))
 
Сергей Таболин:

Do you even read what I write to you?

"Alexey, no offence, but you completely failed to understand what I used TesterStop() for. Moreover, you didn't even try to do it. Since you haven't read what I used it for, I'll briefly explain.

I use it to sift out useless passes of testing andspeed up optimization. Especially genetic optimization. That's why I don't need even one pass at all in this situation! It was replacement of INIT_PARAMETERS_INCORRECT, because when their quantity in OnInit() was large, it led to crashing of genetics..."

What part of this is not clear to you?

P.S. By the way, unlike you, Slava knows exactly what we're talking about. ))

Sergei, TesterStop() is used to prematurely stop testing. What should be the output in this case is the programmer's business. I don't need to know what you must get, the main thing is to stop testing. Everything else is laid down in the computing algorithm.

If you are not satisfied with some intermediate variant of obtained values, you stop testing and return an invented result from the background. If you can't do it, it means that your algorithm is not built correctly somewhere. After all, how to stop testing you are told more than once.

 
Alexey Viktorov:

Sergei, TesterStop() is used to prematurely stop testing. And what you must get in this case is a programmer's business. I don't need to know what you must get, the main thing is to stop testing. Everything else is laid down in the calculation algorithm.

If you are not satisfied with some intermediate variant of obtained values, you stop testing and return an invented result. If you cannot do it, it means that you have built the wrong algorithm somewhere. After all, how to stop testing you are told more than once.

If I offer you to buy a bucket of nails, you're unlikely to be absolutely not interested where I'll get it from and how much it costs. So your answer may be anything: no, I don't want to, I don't want it, well, etc.. The main thing that you and I will be understandable. My answer in such a case is "I have made up a result from a torch", which I personally understand absolutely.

What has become clear in the course of this enquiry is that TesterStop() and ExpertRemove() passed control immediately to OnDeinit() before the new build, while in the new build, they pass control immediately to OnTester() (if there is such). And if in the first case the test result was a NULL, now onTester() we need to check if the output was available at those events (of course this check must be organized) and make our own output. And what result to specify in this case (0 or -99999999) - it's a matter of preferences.