performance/ruby/rails/db question -


I am comparing a online bookmaker barrier for soccer to the site and I am thinking that Ruby / Tracks

I have two models: Stability and constraints

Stability is from home and away teams, and in the model of obstacles, bookmaker IDs, home obstacles, overcome obstacles and overcome There are obstacles.

I have selections that store only selected fixtures / teams in DB

I am thinking of doing this in a way where I create a multi-dimensional array of different books and then add fixture_id and home / draw / 1 for distant , 2 or 3 and then use the keys to add the barriers

something like odds [bookmaker] [stability] [1/2/3] = value then Add barriers = count (obstructions [speculator] [stability] [1/2/3]) ?

Is there any easy way? Maybe it could be in DB?

In view of execution - this is probably not an issue and anyway, for us to demonstrate Do not optimize unless we do not know that we have a problem - I can say that you can start a bookmaker model (only to store the name) and start using the Active Records Association. Three different types of detection barriers Consider, therefore, which can be more flexible, especially if you want to add more bets after you can get something like:

  class bookmaker & lt; ActiveRecord :: Base is_main: the end of the odds is that the class odd & lt; ActiveRecord :: Base # Good Name? Price is almost as common and its meaning is considered incorrect: FISATATO: Bookmaker # We assume that we have the result type = 1/2/3 or maybe: home /: draw /: far and class fixture & lt; ActiveRecord :: is in the base_main: the barrier ends  

What you are trying to do is calculate the best value for each result in all bookmakers who make a price on that stability, Or "over over" If it is less than 100% then a possible arbitration exists.

  class named ode_scope: for_result, lambda {| Res_tp | {: Terms = & gt; ['Type =?', Regatt_tip]}} and class fixtures Df Best_Price (RSSIPEE) # assumes that the barriers you have stored for one percent are strange. For_result (res_type). Minimum (: pctage) end def overround [: home,: away, draw:] Injection (0.0) {| Sum, res_tp | Sum + best_price (res_tp)} End End  

I'm sure the above data is not exactly fit, but it can give an idea how you can go about it.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -