From 7407a45ab56d9d6170694b1e3d2bfdb663d8adee Mon Sep 17 00:00:00 2001 From: Zejin Shi Date: Fri, 17 Mar 2017 12:38:14 +0900 Subject: [PATCH] Change "Generator" to "Task". --- src/Games.jl | 2 +- src/support_enumeration.jl | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Games.jl b/src/Games.jl index afd6aa01..99f7a245 100644 --- a/src/Games.jl +++ b/src/Games.jl @@ -50,6 +50,6 @@ export Player, NormalFormGame, # Types worst_values, outerapproximation, # Support Enumeration - support_enumeration, support_enumeration_gen + support_enumeration, support_enumeration_task end # module diff --git a/src/support_enumeration.jl b/src/support_enumeration.jl index b155d863..7c5cf066 100644 --- a/src/support_enumeration.jl +++ b/src/support_enumeration.jl @@ -29,7 +29,7 @@ minus 1 such pairs. This should thus be used only for small games. """ function support_enumeration(g::NormalFormGame) - task = support_enumeration_gen(g) + task = support_enumeration_task(g) NEs = Tuple{Vector{Float64},Vector{Float64}}[NE for NE in task] @@ -38,9 +38,9 @@ function support_enumeration(g::NormalFormGame) end """ - support_enumeration_gen(g::NormalFormGame) + support_enumeration_task(g::NormalFormGame) -Generator version of `support_enumeration`. +Task version of `support_enumeration`. # Arguments * `g::NormalFormGame`: NormalFormGame instance. @@ -48,24 +48,24 @@ Generator version of `support_enumeration`. # Returns * `::Task`: runnable task for generating Nash equilibria. """ -function support_enumeration_gen(g::NormalFormGame) +function support_enumeration_task(g::NormalFormGame) N = length(g.nums_actions) if N != 2 throw(ArgumentError("Implemented only for 2-player games")) end - task = Task(() -> _support_enumeration_gen(g.players[1].payoff_array, - g.players[2].payoff_array)) + task = Task(() -> _support_enumeration_task(g.players[1].payoff_array, + g.players[2].payoff_array)) return task end """ - _support_enumeration_gen{T<:Real}(payoff_matrix1::Matrix{T}, - payoff_matrix2::Matrix{T}) + _support_enumeration_task{T<:Real}(payoff_matrix1::Matrix{T}, + payoff_matrix2::Matrix{T}) -Main body of `support_enumeration_gen`. +Main body of `support_enumeration_task`. # Arguments * `payoff_matrix1::Matrix{T}`: Payoff matrix of player 1. @@ -75,8 +75,8 @@ Main body of `support_enumeration_gen`. * `Tuple{Vector{Float64},Vector{Float64}}`: Tuple of Nash equilibrium mixed actions. """ -function _support_enumeration_gen{T<:Real}(payoff_matrix1::Matrix{T}, - payoff_matrix2::Matrix{T}) +function _support_enumeration_task{T<:Real}(payoff_matrix1::Matrix{T}, + payoff_matrix2::Matrix{T}) nums_actions = size(payoff_matrix1, 1), size(payoff_matrix2, 1) n_min = min(nums_actions...)