Well, that analogy makes no sense whatsoever.
If god knows exactly what we're going to do, then we don't a have a choice but to do exactly that. If we choose to do something different, then god didn't know what we were going to do.
It depends on God's perspective on time. To us, time is another dimension from which we can only participate in the present and look backwards (and not even very far backwards - or even absolutely backwards - only from what we've experienced, which we also do not have perfect recollection of). To God, if he sits 'outside' of time then he will be able to observe past, present and future without interfering with it. In essence, from God's perspective, He knows because it may have already happened from where He sits.
To us, of course, that may not make much sense from where we sit - but as we understand more about quantum physics it begins to seem possible. In quantum physics we learned that particles can become entangled with particles that don't even exist anymore (from the past) or don't exist yet (in the future). Here is one reference:
http://www.extremetech.com/extreme/...ntanglement-of-photons-through-space-and-time This raises the shocking question of how this can possibly happen unless something about how this entangling behaves does not respect either space or time as we consider it. Time is, therefore, perhaps just a dimension of this created reality - and from a certain frame of reference it is non-linear. This is part of the strange world that we live in.
If you have time, one of the best explanations I've heard on how God can know what we're going to do and also not interfere is from a commentary by Chuck Missler. I don't remember what part it is in, it's possible it is in the Genesis one, but a discussion on Time and Space is on YouTube here:
http://www.youtube.com/watch?v=YJdrhnHj5hE I should note that I don't necessarily agree with everything that he says, there are some parts that I don't, but he makes an interesting point about the possibilities of God's perspective on time.
Edit: Yep, I think that's the one, he starts with the paradox of Fate vs Free will pretty early in that commentary. He starts off with quite a bit of introduction so you'll have to be a little patient to get to that part.
I found a good quote from Einstein in it: "People like us, who believe in physics, know that the distinction between the past, the present and the future, is only a stubbornly persistent illusion."