huntersAdapt: huntersAdapt Hunters Adaptation rule

Description Usage Arguments Value

View source: R/huntersAdapt.R

Description

Hunters compare their vote share or seat share in an election at t, to their vote share or seat share in the election at t-1. If the vote share/ seat share improved they continue moving in the same direction. If the vote share/ seat share did not improve they randomly chooses a new heading between 90 to 270 degrees away from its previous heading.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
huntersAdapt(
  competitorDataFrameHunterAdapts,
  voteTotalsForCompetitorsOldHunterAdapts,
  voteTotalsForCompetitorsNewHunterAdapts,
  seatAllocationForCompetitorsNewHunterAdapts,
  seatAllocationForCompetitorsOldHunterAdapts,
  electoralFormulaHunterAdapts,
  scaledCompetitorAdaptStepSizeHunterAdapts,
  dimOneBoundsHuntersAdapt,
  dimTwoBoundsHuntersAdapt
)

Arguments

competitorDataFrameHunterAdapts

a voteR dataFrame that contains the competitorID, current location, and comeptitor type for each competitor.

voteTotalsForCompetitorsOldHunterAdapts

a numCOmpetitors x 2 matrix containing each competitor's competitorID and their vote share from the previous period.

voteTotalsForCompetitorsNewHunterAdapts

a numCOmpetitors x 2 matrix containing each competitor's competitorID and their vote share from the current period.

seatAllocationForCompetitorsNewHunterAdapts

a numCOmpetitors x 2 matrix containing each competitor's competitorID and their vote share from the previous period.

seatAllocationForCompetitorsOldHunterAdapts

a numCOmpetitors x 2 matrix containing each competitor's competitorID and their vote share from the current period.

electoralFormulaHunterAdapts

The electoral formula being used in the model. In Plurality competitors maximize vote share, in PR systems they maximize seats.

scaledCompetitorAdaptStepSizeHunterAdapts

Size step the party can take. Should be in cartesian distance units.

dimOneBoundsHuntersAdapt

The bounds of the first dimension.

dimTwoBoundsHuntersAdapt

The bounds of the second dimension.

Value

outCompetitorDataFrameCompetitorAdapts


robiRagan/voteR documentation built on Feb. 27, 2020, 6:48 p.m.