I was trying to explain the sorts of algorithms I use at work to a friend the other night. In general, they're called metaheuristics (in particular, I have experience with simulated annealing and genetic algorithms.) I used an analogy of an ordinary heuristic like one that tries to find the shortest path between to points.
Shortest path: Imagine you want to find X marks the spot on a map. However, there are all these barriers in the way and you can't really be sure if the route you're taking will 1) get you there; or 2) get you there with the least steps. However, so long as there is someone/something telling you how far away you are from the X, you should always be able to find the shortest route - if there is one. That's A*.
To describe when to use a metaheuristic, however, I said "well, imagine you don't actually know where X marks the spot is." But it's much worse than that. Imagine you don't really know where it is and no matter which direction you take you don't necessarily or reliably get any closer to X. For example, you start a long way from X; you go ten metres north and you're close; then go twenty metres south and you're just as close. But, actually, the closest you could ever get to X might be five metres east from the start! It just doesn't make any sense. Like someone calling out "hotter" or "colder" seemingly at random when you're trying to find something. They aren't lying to you, it's just really hard to find. If you have a situation like that, use a metaheuristic, or punch them.
Friday, August 27, 2010
Monday, August 23, 2010
WorkChoices and Fair Work Australia
Being a little ignorant of IR policy differences between the ALP and the Liberals, I thought I'd dot-point the similarities and differences they had/have.
Similarities:
Similarities:
- Can only strike during a bargaining period;
- Industry-wide (pattern) bargaining is banned;
- Secret ballot required before industrial action;
- A single, national industrial relations system;
- Focus on enterprise bargaining rather than individual contracts (this wouldn't matter except the Libs removed the "No Disadvantage Test");
- Unfair dismissal legislation is sort-of back with the ALP (so long as you've worked for 6 months in the business; 12 months if less than 15 people in the business);
- With the Liberals, laws prevented union right of entry into the workplace;
The non-voters
I am part of the millions of Australians who don't vote. About 8% of people living in Australia aren't on the electoral roll. There are also about a million overseas who don't vote. Add to that the informal votes, up from 4% to 6% for the 2010 election and you have about 20% of the population eligible to vote who don't.
For a country that rushed in compulsory voting after the massive drop-out 1922 election (60% turnout), I am proud to announce that we're back!
Not that not voting changes anything. How can it? Voting doesn't change anything. Nevertheless, one should not encourage them. It's poor form.
For a country that rushed in compulsory voting after the massive drop-out 1922 election (60% turnout), I am proud to announce that we're back!
Not that not voting changes anything. How can it? Voting doesn't change anything. Nevertheless, one should not encourage them. It's poor form.
Wednesday, August 11, 2010
Watts Riots started today, 1965

The Situationists had a little to say about the riots.
Let the economists fret over the $27 million lost, and the city planners sigh over one of their most beautiful supermarkets gone up in smoke, and McIntyre blubber over his slain deputy sheriff. Let the sociologists bemoan the absurdity and intoxication of this rebellion.
[...]
Until the Watts explosion, black civil rights demonstrations had been kept by their leaders within the limits of a legal system that tolerates the most appalling violence on the part of the police and the racists [...]
[...]
Looting is a natural response to the unnatural and inhuman society of commodity abundance. It instantly undermines the commodity as such, and it also exposes what the commodity ultimately implies: the army, the police and the other specialized detachments of the state’s monopoly of armed violence. What is a policeman? He is the active servant of the commodity, the man in complete submission to the commodity, whose job is to ensure that a given product of human labor remains a commodity [...]
[...]
The rational world produced by the Industrial Revolution has rationally liberated individuals from their local and national limitations and linked them on a global scale; but it irrationally separates them once again, in accordance with a hidden logic that finds its expression in insane ideas and grotesque values. Estranged from their own world, people are everywhere surrounded by strangers.
Labels:
politics,
revolution
Kick Ass
Kick Ass: Clever combination of Watchmen and The Professional. Excellent, ironic portrayal of vigilante fascism. Love the controversy and critical response sections on wikipedia. E.g.
Roger Ebert gave the film one out of four stars. He called the film "morally reprehensible", appalled by the violent scenes in which an 11-year-old girl murders dozens of gang members and is then almost beaten to death by an adult man. "When kids in the age range of this movie's home video audience are shooting one another every day in America, that kind of stops being funny."Does it Robert? Does it really? 'Cause, you know, I was laughing quite a bit through those scenes.
Friday, August 6, 2010
Genetic Algorithms
There is something a little bit creepy about writing genetic algorithms. I'm not quite sure what it is...
// Run selected breeding program
while (stopWatch.Elapsed < _parameters.SimulationExecutionTime)
{
population = Selection(population).ToList();
var children = Breed(population);
Mutate(children);
population.AddRange(children);
}
Labels:
c#,
genetic algorithm,
programming
Wednesday, August 4, 2010
Subversion
I have decided to hide subversive quotes in the software I am working on.
If you find them all, you unlock "The Revolution Complete" achievement.
If you find them all, you unlock "The Revolution Complete" achievement.
Labels:
communism,
programming,
revolution,
wpf
Subscribe to:
Posts (Atom)