Jump to content
xisto Community
Sign in to follow this  
CrazyPensil

A Good Logical Question.... Yep, its me.... Again ;)

Recommended Posts

Again I've faced up with a problem... I'm writing a simple AI for a bot, but it still works in a slow way :*(

 

So, the thing I'mma ask you, dear programmers, is that one:

 

We've got a set of actions that can be done(n).

Each action requires a certain amount of ActionPoints(AP)

Bot has an unknown amount of ap(m)

 

So, we must find Number of possible combinations, given total number of AP, array of actions and their costs.

 

As you might understand, I need the formula.

 

Don't suggest any ways to find the combinations themselves - this is already done by me, that formula would a great deal accelerate the process.

Share this post


Link to post
Share on other sites

OK wait, if you have a set number of actions and each action requires a certain amount of AP, but you do not know the amount of AP, then isn't it going to be the same number of possible solutinos every time, which is all of them...Carefully re-word your problem, its hard to understand. Before anyone can devise any type of "formula", you need to make sure you work out the logic first, and make us be able to understand your logic so we can create a "formula"

Edited by BitShift (see edit history)

Share this post


Link to post
Share on other sites

Haha thats what I was thinking Hercco, either it sounds insanely simple or near impossible. Either way I'm pretty sure we need a more clear explanation and possibly more information. Maybe provide a small scale example?

Share this post


Link to post
Share on other sites

OK, I re-word in a simpler way.Formula gets the data: - Number of AP bot has - Set of actions with cost of each oneAnd gives out the amount of combinations where some of actions ore chosen, but total cost of actions in each combination doesn't exceed total number of AP bot has.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.