funnybenz Posted July 27, 2011 Share Posted July 27, 2011 Hello friends, I have this algorithm about estimate function and i'm one of newbie in PHP. I wonder, if you all could help me to solve this algorithm to PHP language anyway, this algorithm works like a graph. Require: Pt oldEdges=E for all e in Pt do neighbors:=getNeighbors(e, Pt, r) for all n in neighbors do if E(e, n) = null then E.add(e, n) E(e, n).weight = 1/2h else E(e, g).weight+= 1/2h oldEdges.remove((e,n)) end if for all edge in oldEdges do edge.weight-=1/h if edge.weight = 0 then E.remove(edge) end if end for end for end for I would describe some information about the variable in algorithm on the above. [*]variable Pt is save a table that contains the latitude and longitude of the position of the object. [*]variable r is describe neighborhood radius, I think we could assign for some number depends on data of the Pt. [*]getNeighbors is a function that returns measurement from Pt that are within r of object e where r is from the square wave function. square wave function f(x,y) -> 0, if distance(x,y) > r; else 1 I think that's all of information that I've know. Dear friends, I really looking forward for any answers. Thank you Regards, funnybenz Quote Link to comment https://forums.phpfreaks.com/topic/242900-solve-this-algorithm-to-php-code-sos/ Share on other sites More sharing options...
braunshedd Posted July 27, 2011 Share Posted July 27, 2011 Well, your asking us to "help" you translate your code, but you've made no attempt to translate your code at all, so it looks like you want us to do it FOR you... Quote Link to comment https://forums.phpfreaks.com/topic/242900-solve-this-algorithm-to-php-code-sos/#findComment-1247676 Share on other sites More sharing options...
Nodral Posted July 27, 2011 Share Posted July 27, 2011 Please repost in the "Get your homework done for free" forum!! Quote Link to comment https://forums.phpfreaks.com/topic/242900-solve-this-algorithm-to-php-code-sos/#findComment-1247772 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.