genCompetitorType: genCompetitorType Assigns each competitor a type based upon...

Description Usage Arguments Value

View source: R/genCompetitorType.R

Description

Randomly type all competitors in the supoplied dataframe. genCompetitorType is used in conjuction with genIdeals by genCompetitors to generate the characteristics of eac competitor.

Usage

1
2
3
4
5
6
7
genCompetitorType(
  numCompetitorsGenCompType,
  allHunterGenCompType = FALSE,
  probabilityHunterGenCompType = 1,
  probabilityAggregatorGenCompType = 0,
  probabilityPredatorGenCompType = 0
)

Arguments

numCompetitorsGenCompType

scalar Number of voters

allHunterGenCompType

logical If If FALSE (the default) then the distribution of competitor types is determined by the other parameters in this function. If TRUE then all agents will be of the Humter type and will seek votes by first miving at random. If the move increaes vote share then they continue to move in that directon. If the vote share stays the same or decreases then the competitor randomly selects a move that is between 90 and 270 degrees from the direction of their previous move.

probabilityHunterGenCompType

scalar [0,1] The probability that any given competitor will have the Hunter type.

probabilityAggregatorGenCompType

scalar [0,1] The probability that any given competitor will have the Aggregator type.

probabilityPredatorGenCompType

scalar [0,1] The probability that any given competitor will have the Predator type.

Value

outCompetitorType numCompetitors x 1 A vector of competitor types, one for each competitor.


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