Horse Racing Simulation System - PowerPoint PPT Presentation

About This Presentation
Title:

Horse Racing Simulation System

Description:

To demonstrate horse racing simulation ... Background of Horse Racing ... Formulating Horse Racing Schedule. Schedule Query by Stable ... – PowerPoint PPT presentation

Number of Views:464
Avg rating:3.0/5.0
Slides: 43
Provided by: fian7
Category:

less

Transcript and Presenter's Notes

Title: Horse Racing Simulation System


1
  • Horse Racing Simulation System
  • Presented By Ting Hin Chau
  • Supervised By Professor Michael R. Lyu
  • April 2004

2
Agenda
  • Objectives of Project
  • Background of Horse Racing
  • Major Business Functions of Objects
  • System Design
  • Simulation Algorithm
  • Conclusion
  • Q A

3
Objectives
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
  • To demonstrate CORBA implementation
  • To demonstrate horse racing simulation

4

Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Background of Horse Racing
  • Jockey Club
  • Stable
  • Gambler

5
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Background of Horse Racing
  • Inefficient Procedures
  • Race Registration Paper Work
  • Betting Off-course betting branches

6
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Background of Horse Racing
  • Difficult Result Prediction
  • Personal Judgement

7
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Business Functions
  • Jockey Club
  • Formulating Horse Racing Schedule
  • Schedule Query by Stable
  • Processing Horse Registration for a Race by
    Stable

8
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Business Functions
  • Jockey Club
  • Race Query by Gamblers
  • Accepting Bets from Gamblers
  • Calculating Odds (Appendix 1)
  • Running Races
  • Dividend Payout

9
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Business Functions
  • Stable
  • Horse Query by Gamblers
  • Horse Registration for a Race

10
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Business Functions
  • Gambler
  • Depositing Money to Betting Account
  • Placing Bets

11
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Interaction

12
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Object Request Broker
  • VisiBroker for Java 4.0
  • Service Lookup
  • Object Instantiation
  • Connection Setup between Client and Server
    Objects

13
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Object Request Broker

14
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Server Objects
  • Interfaces defined in CORBA/IDL

interface Buyer attribute unsigned
longBuyerID attribute stringBuyerPassword attrib
ute stringBuyerName attribute floatBalance attri
bute stringAccountNumber exception
NotEnoughMoneyInAccount void deposit(in
float amount) void withdraw(in unsigned long
amount) raises(NotEnoughMoneyInAccount) void
edit(in string buyerName, in string
buyerPassword, in string accountNumber)
15
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • CORBA/IDL to Java Mapping

IDL Java
module package
interface interface
operation method
attribute method pair
exception exception
16
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • idl2java
  • Interface file
  • Helper file
  • Holder file
  • Stub file
  • POA file

17
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Server Objects
  • Buyer
  • BuyerProcessor
  • Stable
  • StableProcessor
  • Race

18
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Client GUI
  • RaceAdminClient
  • StableClient
  • BuyerClient

19
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Client GUI
  • RaceAdminClient

20
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Client GUI
  • StableClient

21
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Client GUI
  • BuyerClient

22
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
System Design
  • Database Server
  • Oracle 8i
  • Persistent storage of data
  • Maintaining data integrity
  • E-R diagram (Appendix 2)

23
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Monte Carlo Simulation
  • Simulation with a built-in random process
  • Different possible outcomes

24
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Steps of Simulation (Appendix 3)
  • 1. Data Input
  • Gather data on historical ranks of a horse
  • Transform these ranks to a value R/N, which is
    rank/number of horses in the race

25
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Steps of Simulation
  • 2. Distribution Construction
  • Form frequency distribution
  • Form probability distribution
  • Form cumulative probability distribution

26
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Steps of Simulation

27
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Steps of Simulation
  • 3. Draw a sample from distribution
  • Generate a random number N from 0 to 1
  • N refers to P(X lt x), where X is R/N

28
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Steps of Simulation

29
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Steps of Simulation
  • 4. Compare R/N across horses
  • Sort the R/N values of the horses in a race
  • A horse with a smaller R/N beats out a horse with
    a higher R/N

30
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Simulation Algorithm
  • Assumptions of Simulation
  • Independent distribution of R/N
  • Factors including location of racecourse, lane,
    and jockey are insignificant
  • Data from the 10 most recent races are used

31
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Conclusion
  • CORBA
  • Language independent
  • Different platforms
  • ORB expensive

32
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Conclusion
  • Simulation
  • Mimics the random factor in horse racing
  • Choice of size of distribution is hard to
    determine
  • Error of prediction can be estimated

33
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 1
  • Calculation of Odds
  • 1. Win Odds
  • dw ?bi / bw
  • 2. Place Odds
  • dw1 (?bi - bw1 - bw2 - bw3) /( 3 bw1) 1

34
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 2
35
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation

36
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation

37
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation

38
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation
  • Two points on the cumulative distribution (x1,
    y1) and (x2, y2), for instance, for horse 1, they
    correspond to (0.25, 0.5) and (0.25, 0.6), will
    be used to calculate the final score of a horse
    by linear equation , based on the random number
    generated.

39
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation
  • For horse 1, point 1 (x1, y1) is (0.4, 0.2) and
    point 2 (x2, y2) is (0.5, 03)
  • R/N of horse 1
  • (rand1-y1)((x2-x1)/(y2-y1)) x1
  • (0.5379783655654367 0.2) (0.25
    0.25)/(0.6-0.5) 0.25
  • 0.25

40
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation
  • For horse 2, point 1 (x1, y1) is (0.4, 0.2) and
    point 2 (x2, y2) is (0.5, 0.3).
  • R/N of horse 2
  • (rand2-y1)((x2-x1)/(y2-y1)) x1
  • (0.21096296234313094 0.2) (0.5
    0.4)/(0.3-0.2) 0.4
  • 0.410962962

41
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation
  • For horse 3, point 1 (x1, y1) is (0, 0) and point
    2 (x2, y2) is (0.125, 0.1).
  • R/N of horse 3
  • (rand2-y1)((x2-x1)/(y2-y1)) x1
  • (0.02229991816731558 0) (0.125 0)/(0.1-0)
    0
  • 0.027874898

42
Objectives / Background / Business Functions /
System Design / Simulation Algorithm
Appendix 3
  • Simulation Calculation
  • For horse 4, point 1 (x1, y1) is (0.5355, 0.4)
    and point 2 (x2, y2) is (0.545455, 0.5).
  • R/N of horse 3
  • (rand2-y1)((x2-x1)/(y2-y1)) x1
  • (0.4920612612595172 0.4) (0.545455
    0.5355)/(0.5-0.4) 0.5355
  • 0.544664699
Write a Comment
User Comments (0)
About PowerShow.com