protected internal virtual void Success()
{
lock (this)
{
if (debug)
{
Console.Out.WriteLine(name + " Success");
}
if (_abort)
return;
count++;
System.Threading.Thread.Sleep(0);
bool better = UpdateBest();
if (IsOption(Better))
{
if (_monitor != null)
{
//monitor.ADDData(this, bestValue);
int value = solution.ObjectiveIntValue;
_monitor.ADDData(this, value);
}
if (!better)
return;
}
else
{
if (_monitor != null)
{
int value = solution.ObjectiveIntValue;
_monitor.ADDData(this, value);
}
}
_ready = true;
System.Threading.Monitor.PulseAll(this);
while (!_abort && _ready)
{
try
{
System.Threading.Monitor.Wait(this);
}
catch (System.Threading.ThreadInterruptedException)
{
}
}
}
}