Giter Club home page Giter Club logo

Comments (16)

030helios avatar 030helios commented on August 16, 2024

may I see your code?

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

could you send me e-mail address?I can send to you.Thank you.

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

[email protected]

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

already send.Thank you.

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

see if this helps:
qDebug()<< "MCTS_Nodes"<< node_count<<"剩余落子点数:"<<best_child->maxChildrenNum;
delete node; //here

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

It does not work.the same problem.

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

then maybe give it a destructor
Node::~Node()
{
for(auto child :children)
delete child;
}

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

image
It can not add the fuction

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

then we work around it

void Node::delNode()
{
    for (auto child : children)
        child->delNode();
    delete this;
}

qDebug() << "MCTS_Nodes" << node_count << "剩余落子点数:" << best_child->maxChildrenNum;
node->delNode();

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

It already does not work.

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

well if you can't delete it don't allocate the node yourself.

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

I tried to delete the nodes, but it didn't work, and Monte Carlo searches would not work if no nodes were allocated.

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

I try again ,find it will be crashed whatever times I set simulation.

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

No. what I meant is don't allocate them yourself

Store the children in, say, a vector. Avoid using thing like "node newnode = new node".
something like

node newchild
//do your expand here
children.push_back(newchild)

from othellomcts-dataoriented.

030helios avatar 030helios commented on August 16, 2024

this way the default constructor will deallocate the children for you.

from othellomcts-dataoriented.

177715031 avatar 177715031 commented on August 16, 2024

I have a try

from othellomcts-dataoriented.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.