Title: Example Matlab Simulation
1Example Matlab Simulation
2Based on Teaching Social Simulation with
MatlabJournal of Artificial Societies and Social
Simulation vol. 3, no. 1, ?lthttp//www.soc.surrey.
ac.uk/JASSS/3/1/forum/1.htm
3"Take it or leave it."
- A friend is looking for a mate
- Goal Find matches that meet criterion number of
desirable attributes in a mate - honesty, intelligence, beauty, lets you cheat off
them - Different people have different numbers of these
attributes - we give them a score based on the
number of desirable attributes they have. - we
can describe the population by a distribution on
this score. - Picky friend makes a wants a 12.
- How hard will that be to achieve?
4Prospect distribution
- Prospects scores are normally distributed and
have mean 6, standard deviation 3. - Scores can be negative, but all scores are
integers.
Meanscore 6 Stdscores 3 NumberProspects
1000 prospectsceil(63randn(1,NumberProspects))
This is your dating pool
5How many prospects for friend?
goodonesfind(prospects gt 12)
6Now what?
- Which dates should the friend take?
- How many possible matches?
- That depends on the PROSPECTs criteria
- We need to know our friends score. Say it is a
10 - Assign each PROSPECT a criteria.
- Let us say PROSPECT criteria are about /-2
points from their own score on average. - Finally MATCHES are made first date that both
exceed criteria.
7PROSPECT CRITERIA
prospectcriteriaceil(prospects2randn(1,NumberPr
ospects))
8MATCH GAME
Isdatablecount 0 For possibledates1NumberPro
spects, isdatable prospects(possibledates)gtfri
endscriterion isdatablecount isdatablecount
1 if isdatable, ismatch friendsscore gt
prospectscriterion(possibledates if
ismatch, matchscore prospects(possibledates)
break end end end
9Be systematic!
- What is the average match scores
- As a function of friends score?
- What is the effect of
- Dating pool size
- Pool quality