Skip to content

Commit

Permalink
Revise project with TheoryOfGames
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-f committed May 22, 2023
1 parent 365ce75 commit 51df662
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 51 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- name: Clone Games.jl
run: git clone https://github.com/SPSUnipi/Games.jl
- name: Install private repo
run: julia --project -e 'using Pkg; Pkg.add(; url="Games.jl")'
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
Expand Down
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
ExportAll = "ad2082ca-a69e-11e9-38fa-e96309a31fe4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
Games = "eb50afb4-6f20-4b37-9b66-473e668300bf"
TheoryOfGames = "eb50afb4-6f20-4b37-9b66-473e668300bf"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LayeredLayouts = "f4a74d36-062a-4d48-97cd-1356bad1de4e"
Expand All @@ -21,16 +21,16 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
julia = "1"
CSV = "0"
CSV = "0.10"
DataFrames = "1"
ExportAll = "0.1"
FileIO = "1"
Formatting = "0"
Games = "0"
Formatting = "0.4"
TheoryOfGames = "0.1"
JuMP = "1"
LayeredLayouts = "0.2"
MathOptInterface = "1.0"
Plots = "1"
SankeyPlots = ">= 0.2.2"
XLSX = "0"
YAML = "0"
SankeyPlots = "0.2.2"
XLSX = "0.9"
YAML = "0.4"
2 changes: 1 addition & 1 deletion examples/RunSingleModel_complete.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using EnergyCommunity, JuMP
using HiGHS, Plots
using Gurobi
using Combinatorics
using Games
using TheoryOfGames
using DataFrames


Expand Down
2 changes: 1 addition & 1 deletion run_cloud/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ExportAll = "ad2082ca-a69e-11e9-38fa-e96309a31fe4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
Games = "eb50afb4-6f20-4b37-9b66-473e668300bf"
TheoryOfGames = "eb50afb4-6f20-4b37-9b66-473e668300bf"
Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/backup/run_tests_enum_cloud.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand Down
15 changes: 14 additions & 1 deletion run_cloud/compare_cloud_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"using HiGHS, Plots\n",
"using JuMP\n",
"using Gurobi\n",
"using Games\n",
"using TheoryOfGames\n",
"using TickTock\n",
"using Combinatorics\n",
"using DataFrames\n",
Expand All @@ -34,6 +34,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -59,6 +60,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -93,6 +95,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -128,6 +131,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -160,6 +164,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -197,6 +202,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -237,6 +243,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -337,6 +344,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -367,6 +375,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -406,13 +415,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## ALL: Merge all data into final files"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -451,6 +462,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -489,6 +501,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/dev_tests_iter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/plotting_paper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"using HiGHS, Plots, StatsPlots, CategoricalArrays\n",
"using JuMP\n",
"using Gurobi\n",
"using Games\n",
"using TheoryOfGames\n",
"using TickTock\n",
"using Combinatorics\n",
"using DataFrames\n",
Expand Down
4 changes: 2 additions & 2 deletions run_cloud/run_tests_cloud.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand All @@ -35,7 +35,7 @@ using YAML
# General optimizer
OPTIMIZER = optimizer_with_attributes(Gurobi.Optimizer, "OutputFlag"=>0, "Threads"=>10)

# Optimizer for row-generation techniques, used in the IterMode of Games.jl
# Optimizer for row-generation techniques, used in the IterMode of TheoryOfGames.jl
OPTIMIZER_ROW_GENERATION = optimizer_with_attributes(Gurobi.Optimizer,
"OutputFlag"=>1,
"LogToConsole"=>0,
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/run_tests_enum_cloud.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/run_tests_iter_cloud_cplex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/run_tests_iter_cloud_gurobi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand Down
2 changes: 1 addition & 1 deletion run_cloud/run_var_least_core_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using FileIO
using HiGHS, Plots
using JuMP
using Gurobi
using Games
using TheoryOfGames
using TickTock
using Combinatorics
using DataFrames
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyCommunity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module EnergyCommunity
using DataFrames
using MathOptInterface
using Base.Iterators
using Games
using TheoryOfGames
# import ECharts
import SankeyPlots
import CSV
Expand Down Expand Up @@ -52,7 +52,7 @@ module EnergyCommunity
# include the abstract types for encapsuling the method
include("ECModel.jl")

# include the callbacks to be used in the Games package
# include the callbacks to be used in the TheoryOfGames package
include("Games_jl_interface.jl")

@exportAll()
Expand Down
14 changes: 7 additions & 7 deletions src/Games_jl_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ catch e
@warn "Special features by CPLEX are not enabled"
end

"""Function to create output data after the optimization for Games.jl"""
"""Function to create output data after the optimization for TheoryOfGames.jl"""
function create_output_data(ecm_copy::ModelEC, number_of_solutions)
user_set_tot = axes(ecm_copy.model[:profit_distribution])[1]

Expand Down Expand Up @@ -909,9 +909,9 @@ end
"""
IterMode(ECModel::AbstractEC, base_group_type::AbstractGroup)
Function to create the IterMode item for the Games.jl package
Function to create the IterMode item for the TheoryOfGames.jl package
"""
function Games.IterMode(
function TheoryOfGames.IterMode(
ECModel::AbstractEC,
base_group_type::AbstractGroup;
no_aggregator_type::AbstractGroup=GroupNC(),
Expand Down Expand Up @@ -940,7 +940,7 @@ function Games.IterMode(
kwargs...
)

robust_mode = Games.IterMode([EC_CODE; ECModel.user_set], utility_callback, worst_coalition_callback)
robust_mode = TheoryOfGames.IterMode([EC_CODE; ECModel.user_set], utility_callback, worst_coalition_callback)

return robust_mode
end
Expand All @@ -949,12 +949,12 @@ end
"""
EnumMode(ECModel::AbstractEC)
Function to create the EnumMode item for the Games.jl package
Function to create the EnumMode item for the TheoryOfGames.jl package
"""
function Games.EnumMode(ECModel::AbstractEC, base_group::AbstractGroup; verbose::Bool=true, kwargs...)
function TheoryOfGames.EnumMode(ECModel::AbstractEC, base_group::AbstractGroup; verbose::Bool=true, kwargs...)
utility_callback = to_utility_callback_by_subgroup(ECModel, base_group; kwargs...)

enum_mode = Games.EnumMode([EC_CODE; ECModel.user_set], utility_callback; verbose=verbose)
enum_mode = TheoryOfGames.EnumMode([EC_CODE; ECModel.user_set], utility_callback; verbose=verbose)

return enum_mode
end
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EnergyCommunity = "2f2d8a28-e724-42c4-aa4e-51fe4e6b7a61"
ExportAll = "ad2082ca-a69e-11e9-38fa-e96309a31fe4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
Games = "eb50afb4-6f20-4b37-9b66-473e668300bf"
TheoryOfGames = "eb50afb4-6f20-4b37-9b66-473e668300bf"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Expand Down
10 changes: 5 additions & 5 deletions test/compare_profit_redistribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"# Compare EC profit redistribution\n",
"\n",
"This notebook aims at comparing the profit redistribution for an Energy Community\n",
"using the package EnergyCommunity.jl and Games.jl"
"using the package EnergyCommunity.jl and TheoryOfGames.jl"
]
},
{
Expand Down Expand Up @@ -77,7 +77,7 @@
"using HiGHS, Plots\n",
"using JuMP\n",
"using Gurobi\n",
"using Games\n",
"using TheoryOfGames\n",
"using TickTock\n",
"using Combinatorics\n",
"using DataFrames\n",
Expand Down Expand Up @@ -111,7 +111,7 @@
"# General optimizer\n",
"OPTIMIZER = optimizer_with_attributes(Gurobi.Optimizer, \"OutputFlag\"=>0, \"Threads\"=>10)\n",
"\n",
"# Optimizer for row-generation techniques, used in the IterMode of Games.jl\n",
"# Optimizer for row-generation techniques, used in the IterMode of TheoryOfGames.jl\n",
"OPTIMIZER_ROW_GENERATION = optimizer_with_attributes(Gurobi.Optimizer,\n",
" \"OutputFlag\"=>1,\n",
" \"LogToConsole\"=>0,\n",
Expand Down Expand Up @@ -227,7 +227,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Calculate the reward distribution functions by enumerative techniques (EnumMode in Games.jl)"
"## Calculate the reward distribution functions by enumerative techniques (EnumMode in TheoryOfGames.jl)"
]
},
{
Expand Down Expand Up @@ -430,7 +430,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Calculate the reward distribution functions by row-generation techniques (IterMode in Games.jl)"
"## Calculate the reward distribution functions by row-generation techniques (IterMode in TheoryOfGames.jl)"
]
},
{
Expand Down
Loading

2 comments on commit 51df662

@davide-f
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/84046

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 51df662ea50697900bab0a14f9e923fdcf144054
git push origin v0.1.0

Please sign in to comment.