Thursday, August 11, 2011

Budgeter

Hello Everyone!

I've decided on a project to do before I have to go back to school. I'm making a program that is effectively a smart checkbook. Only, right now I'm not making it to keep track of finances, but to budget them effectively.

Basically, When I get my checks from work, I open notepad and a calculator, enter my check amount into it, then slowly subtract out items as I enter them into the notepad document. So, basically I'm wrapping my setup into a program, and it seems like it's a good idea, mainly because 4 of my friends have taken an interest and have already asked to test my program once it's done. (As done as any program can get, aka release version that gets patches)

Right now I'm fighting between the urge to continue working on it, and the urge to go to bed, it is midnight, and I do have to get up at 7 tomorrow.... but when the mood takes one to code, you do not simply ignore it.

Monday, August 8, 2011

Cluster is Done, next project

I  made it about halfway through Cluster Swarm before getting to overwhelmed by work, friends, and readings. So I took a break from it, and never really got back to it. All the pieces are there, all the ideas, it's just a matter of putting the pieces together. However, I feel like my time would be better spent on other projects.

A few things I've considered, a Budgeting program that I could use to do my budgeting, (I do it in notepad right now), I could make it entirely in Java to make it transportable, I could make it customizable, and also include plenty of features that would be useful. I could model the Towers of Hanoi, and perhaps use what I've learned about genetic algorithms and evolutionary programming to evolve strategies and solutions to the towers. Although I'd probably restrict it to n <= 4 disks for the sake of managing bits. One way I thought about doing it was to use 30 bits to represent a solution to n=4 disks, each bit being able to be one of the three towers. I could initialize random bits to a few, then run it through a validity checker, essentially my fitness function, to see how well it does and to make sure it doesnt place a larger disk on a smaller disk. and then could add in how close to the optimal solution it was to determine it's fitness.

I also thought about representing the towers and their moves as a Grammar.

S -> aC | bC
A -> aB | aC
B -> bA | bC
C -> cA | cB | cƛ
ƛ -> null (end of moves)

You could simply build up possible moves, their validity would be checked by running them through a simulation of the towers, and then calculate how well they did. From their you could breed good solutions with other ones using crossover and mutation, or possibly use some type of neural net to 'train' a program to have tendancies to lean towards one change from one move to another. I'm not entirely sure on if I'm going to do this project yet or not. It's still up in the air.

Thursday, June 16, 2011

Cluster Goal Driven complete

Just a quick update, the third phase of the cluster project is complete! Only one more phase (albeit large) remains! The documentation im writing up with it is up to date as well!

Wednesday, June 8, 2011

Cluster AI so far

I realize it has been a while since my last update, I blame this on my poor internet quality and working a full time job. However, Despite these time consuming things, I'm up to the Cluster with Obstacles, which you didn't know. It was quite wonderful how I implemented the obstacles, or at least I think so. I used a splay tree to do it :) coding a splay tree in C++ was pretty interesting, and working out the kinks was a bit time consuming, ubut after a days work and 3 different implementations, I had a working splay tree.

I just started working on Cluster Goal Driven a few days ago but haven't had time to really work on it too much yet, hopefully I can do that on sunday, we'll find out. Stay tuned for few and far between updates!

Sunday, May 8, 2011

Cluster Basic Complete

Like I said in my last post, I don't think is going to be a large project at all, but I hope I'm wrong.

So far, it has been as I predicted, the coding took me about 2-3 hours or so of actual coding and testing. I spent more time drinking water and talking to a friend online while I did the code then I actually coded, but it is done.

Cluster Basic is, well, basic. It avoids no obstacles, has no graph/grid structure it needs to index into because it has no obstacles, and it's easy enough to understand. The corner state of the box is there to be used, but isn't really used by the Cluster code. Because the Cluster doesn't actually care too much about where it's putting the members at. Because to it, the members are just a number stored in population that it checks against to make sure it has enough force to push with. You do need 2 members to push the box at all, even if 1 could do it by himself by force alone, in order to push in a horizontal or vertical line you require two members.

I'm going to type up a draft of a paper to accompany this project, and get it to the point where it adequately describes Cluster Basic, and put down all my ideas before I start working on Cluster with Obstacles.

Friday, May 6, 2011

New Project: Cluster

Alright, Cluser isn't a very good name so far, but I'll think of a better one. Anyway, the point is to have an object B (that is a box), and a goal point G, and a Cluster C of small workers that move the Box to the Goal by working together to rotate and push the box.

I've just started working on it, even though I did start working on something like it before, although I won't go into detail on it. Anyway, there are a few things I know I'm already going to do.

The box's state can be represented by an array that holds it's position and the amount of movement the box will move next step of the simulation, as well as the mass of the box. Also, if I want, I can create a boolean table that will tell whether a given part of the box is being pushed or not, this can be used by C to determine where to place it's members in order to push it. Makes sense?

Also, the Cluster will determine how to move the box based on the manhatten distance between it and the goal. So most of the time I expect the Box to be moving diagonally toward the goal. I'll create this project without obstacles first, but once I add in obstacles I'll probably move from an array to represent the space that C,B, and G live in to some type of Graph, and then I can start applying path finding algorithms (specfically Dijkstras A* algorithm) to the search space. Either that, or come up with my own way of dealing with it. (Minding that if I did want to use Graphs, obstacles would be nodes with HUGE weights/cost to traverse)

Alright, I've got the main ideas written in my notebook, and next I'll start coding up the classes and functions. I don't think this is going to be a very large project at all. Hopefully I'm wrong!

Thursday, May 5, 2011

Runtime Analysis On Turret3D

Since I have yet to decide on another project, I decided to do some runtime analysis on my program. At first, I looked at just the complexity of the overall algorithm, and figured it to be O(n) where n is the max lookahead value for the targeting algorithm, but since that literally took 2 seconds of thinking to do, I decided to figure out the more specific runtime, so I started checking on the complexity of the mathematical operations used within my code. To save myself the effort of typing it all up, and because blogger doesn't support latex embedded math typescripting (I believe), here's a screenshot of part of my paper that I wrote up.

If you do the math, the numbers won't add up quite correctly, the reason for the addition complexity in the actual runtime (the first line in the picture) is because of the boolean checks used to test if the loop should terminate or not.

The runtime is dominated by it's multiplications, as well as it's loop of course. So instead of just O(n) it's O(n * multiplications * trig). But, the addition and boolean constant time operations are negligible really, but they're included for specificity's sake.

I really want to create something involving AI, or using some Genetic Algorithms. But I have yet to figure out exactly what I want to do