diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 282712c..6967bfc 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-09T16:54:20","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-09T16:54:31","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/dev/elements/index.html b/dev/elements/index.html index 69e9e9c..a1c1a89 100644 --- a/dev/elements/index.html +++ b/dev/elements/index.html @@ -1,2 +1,2 @@ -Elements · GamsStructure.jl

Elements

GamsStructure.GamsElementType
GamsElement(name::union{Symbol,Tuple}, description::String="", active::Bool = true)

A base struct for GamsSets. Each Name will be converted to a symbol. The active keyword denotes if the element should appear in sets.

source
+Elements · GamsStructure.jl

Elements

GamsStructure.GamsElementType
GamsElement(name::union{Symbol,Tuple}, description::String="", active::Bool = true)

A base struct for GamsSets. Each Name will be converted to a symbol. The active keyword denotes if the element should appear in sets.

source
diff --git a/dev/parameters/index.html b/dev/parameters/index.html index f13fd8c..df4e425 100644 --- a/dev/parameters/index.html +++ b/dev/parameters/index.html @@ -1,17 +1,17 @@ -Parameters · GamsStructure.jl

Parameters

GamsStructure.ParameterType
Parameter(GU,domain::Tuple{Vararg{Symbol}};description::String="") = new{Float64,length(domain)}(GU,domain,Dict{Any,Float64}(),description)

Container to hold parameters. Highly recommended to create using the @parameter macro.

Parameters can be indexed either by set name

P[:set1,:set2]

or by list of element names

P[[:element1,:element2],[:e1,:e2]]

or a mix of both

P[:set1,:e1]

Order of precedence is set then element, so if you have an element with the same symbol as the set name, there will be a conflict. You can either wrap the element name in a vector or avoid this.

source
GamsStructure.@parameterMacro
@parameter(GU, name, domain, kwargs...)

Create a parameter in the universe. Also puts the name in the local namespace.

@parameter(GU, p, (:I,:J), description = "this is p")

This assumes both I and J are sets already in GU. The description is an optional (but recommended) argument.

source
GamsStructure.@parametersMacro
@parameters(model, block)

Plural version of @parameter.

@parameters(GU, begin
+Parameters · GamsStructure.jl

Parameters

GamsStructure.ParameterType
Parameter(GU,domain::Tuple{Vararg{Symbol}};description::String="") = new{Float64,length(domain)}(GU,domain,Dict{Any,Float64}(),description)

Container to hold parameters. Highly recommended to create using the @parameter macro.

Parameters can be indexed either by set name

P[:set1,:set2]

or by list of element names

P[[:element1,:element2],[:e1,:e2]]

or a mix of both

P[:set1,:e1]

Order of precedence is set then element, so if you have an element with the same symbol as the set name, there will be a conflict. You can either wrap the element name in a vector or avoid this.

source
GamsStructure.@parameterMacro
@parameter(GU, name, domain, kwargs...)

Create a parameter in the universe. Also puts the name in the local namespace.

@parameter(GU, p, (:I,:J), description = "this is p")

This assumes both I and J are sets already in GU. The description is an optional (but recommended) argument.

source
GamsStructure.@parametersMacro
@parameters(model, block)

Plural version of @parameter.

@parameters(GU, begin
     p, (:i,:j), (description = "This is p",)
-    t, :i

This create two parameters, p and t. p will have a description.

source
GamsStructure.load_parameterMethod
load_parameter(GU::GamsUniverse,
                path_to_parameter::String,
                domain::Tuple{Vararg{Symbol}};
                description::String = "",
                columns::Union{Vector{Int},Missing} = missing,
                value_name = :value
-               )

Load and return a parameter from a CSV file.

GU - Parent universe. The parameter will not be added to the universe

path_to_parameter - Where the parameter lives

domain - A tuple of the names of the domain sets

description - A description of the parameter. Defaults to empty string

columns - If the names in the CSV don't match the set names, use this to specify which columns correspond to the sets.

value_name - The name of the column where the values live. Can also be an integer.

This function requires a specific format of CSV file:

set_1set_2value
.........

By default, the function expects the columns names in the CSV to match the set names, however, this can be modified using the columns parameter.

source
GamsStructure.load_parameter!Method
load_parameter!(GU::GamsUniverse,
+               )

Load and return a parameter from a CSV file.

GU - Parent universe. The parameter will not be added to the universe

path_to_parameter - Where the parameter lives

domain - A tuple of the names of the domain sets

description - A description of the parameter. Defaults to empty string

columns - If the names in the CSV don't match the set names, use this to specify which columns correspond to the sets.

value_name - The name of the column where the values live. Can also be an integer.

This function requires a specific format of CSV file:

set_1set_2value
.........

By default, the function expects the columns names in the CSV to match the set names, however, this can be modified using the columns parameter.

source
GamsStructure.load_parameter!Method
load_parameter!(GU::GamsUniverse,
                 path_to_parameter::String,
                 name::Symbol,
                 domain::Tuple{Vararg{Symbol}};
                 description::String = "",
                 columns::Union{Vector{Int},Missing} = missing,
                 value_name = :value
-                )

Identical to load_parameter except it includes the parameter in GU.

source
+ )

Identical to load_parameter except it includes the parameter in GU.

source
diff --git a/dev/sets/index.html b/dev/sets/index.html index b8c945b..bfd0bcd 100644 --- a/dev/sets/index.html +++ b/dev/sets/index.html @@ -1,6 +1,6 @@ -Sets · GamsStructure.jl

Sets

GamsStructure.GamsSetType
GamsSet(Elements::Vector{GamsElement}, description = "")

Container to hold GamsElements.

Best way to create a new set is using the @set macro.

source
GamsStructure.GamsSetMethod
GamsSet(x::Tuple...;description = "")

GamsSet constructor for a tuple of the form (name,description) which will be made into GamsElements

source
GamsStructure.GamsSetMethod
GamsSet(x::Vector{Tuple{Symbol,String}};description = "")

GamsSet constructor for a vector of tuples of the form (name,description) which will be made into GamsElements

source
GamsStructure.GamsSetMethod
GamsSet(e::Vector{Symbol};description = "")

GamsSet constructor for a tuple of symbols which will be made into GamsElements with empty description.

source
GamsStructure.GamsDomainSetMethod
GamsDomainSet(base_path::String,set_info::Tuple;description = "")

Load data from a single column of a CSV into a GamsSet.

The variable set_info is a tuple of the form (Symbol,Int) where the Int is the column to load.

#Should be modified to be separate inputs.

source
GamsStructure.@setMacro
@set(GU, set_name, description, block)

Macro to create a GamsSet.

@set(GU,I,"example set",begin
+Sets · GamsStructure.jl

Sets

GamsStructure.GamsSetType
GamsSet(Elements::Vector{GamsElement}, description = "")

Container to hold GamsElements.

Best way to create a new set is using the @set macro.

source
GamsStructure.GamsSetMethod
GamsSet(x::Tuple...;description = "")

GamsSet constructor for a tuple of the form (name,description) which will be made into GamsElements

source
GamsStructure.GamsSetMethod
GamsSet(x::Vector{Tuple{Symbol,String}};description = "")

GamsSet constructor for a vector of tuples of the form (name,description) which will be made into GamsElements

source
GamsStructure.GamsSetMethod
GamsSet(e::Vector{Symbol};description = "")

GamsSet constructor for a tuple of symbols which will be made into GamsElements with empty description.

source
GamsStructure.GamsDomainSetMethod
GamsDomainSet(base_path::String,set_info::Tuple;description = "")

Load data from a single column of a CSV into a GamsSet.

The variable set_info is a tuple of the form (Symbol,Int) where the Int is the column to load.

#Should be modified to be separate inputs.

source
GamsStructure.@setMacro
@set(GU, set_name, description, block)

Macro to create a GamsSet.

@set(GU,I,"example set",begin
     element_1, "Description 1"
     element_2, "Description 2"
     element_3, "Description 3"
-end)

This will put the set I in the local name space as well.

source
GamsStructure.load_setFunction
load_set(path::String;description = "",aliases=[])

Load a GamsSet from a CSV file at the given location.

Sets must be one dimensional (at least for now) and it's assumed the first column are the elements and the second column is the description. If the second column is missing, the description is ""

source
GamsStructure.load_set!Function
load_set!(GU::GamsUniverse,set_name::Symbol,path::String;description="",aliases=[])

Same as load_set, except the set gets added to the universe.

source
GamsStructure.@load_sets!Macro
@GamsSets(GU,base_path,block)

Load a collection of sets from a file. This will search for the file base_path\name.csv where name is the first entry of each line in the block.

@GamsSets(GU,"sets",begin :i, "Set 1", filepath => "othername.csv" :j, "Set 2" end)

source
+end)

This will put the set I in the local name space as well.

source
GamsStructure.load_setFunction
load_set(path::String;description = "",aliases=[])

Load a GamsSet from a CSV file at the given location.

Sets must be one dimensional (at least for now) and it's assumed the first column are the elements and the second column is the description. If the second column is missing, the description is ""

source
GamsStructure.load_set!Function
load_set!(GU::GamsUniverse,set_name::Symbol,path::String;description="",aliases=[])

Same as load_set, except the set gets added to the universe.

source
GamsStructure.@load_sets!Macro
@GamsSets(GU,base_path,block)

Load a collection of sets from a file. This will search for the file base_path\name.csv where name is the first entry of each line in the block.

@GamsSets(GU,"sets",begin :i, "Set 1", filepath => "othername.csv" :j, "Set 2" end)

source
diff --git a/dev/universe/index.html b/dev/universe/index.html index 296aaa3..9d64102 100644 --- a/dev/universe/index.html +++ b/dev/universe/index.html @@ -1,10 +1,10 @@ Gams Universe · GamsStructure.jl

Gams Universe

GamsStructure.GamsUniverseType
GamsUniverse(sets::Dict{Symbol,GamsSet}
             parameters::Dict{Symbol,GamsParameter}
-            scalars::Dict{Symbol,GamsScalar})

Note: scalars are going to be deprecated soon.

Access objects like an array,

GU[:X]

This will return the X object, either a set or parameter. The search order is sets first, then parameters.

Print a universe to see it's members and their descriptions.

source
GamsStructure.load_universeMethod
load_universe(path::String;
+            scalars::Dict{Symbol,GamsScalar})

Note: scalars are going to be deprecated soon.

Access objects like an array,

GU[:X]

This will return the X object, either a set or parameter. The search order is sets first, then parameters.

Print a universe to see it's members and their descriptions.

source
GamsStructure.load_universeMethod
load_universe(path::String;
               to_load = [],
               nGU::GamsUniverse = GamsUniverse(),
-              raw_text=true)

Load a universe from the path.

path - Universe location

to_load - Load specific sets and parameters

nGU - Add sets and parameters to an existing universe

raw_text - Denote if a universe is saved as raw_text or in a binary format.

source
GamsStructure.unloadMethod
unload(GU::GamsUniverse,
+              raw_text=true)

Load a universe from the path.

path - Universe location

to_load - Load specific sets and parameters

nGU - Add sets and parameters to an existing universe

raw_text - Denote if a universe is saved as raw_text or in a binary format.

source
GamsStructure.unloadMethod
unload(GU::GamsUniverse,
        path;
        to_unload = [],
-       raw_text = true)

Save a universe from the path.

GU - The universe to save

path - Universe location

to_unload - Unload specific sets and parameters

raw_text - Denote if a universe is saved as raw_text or in a binary format.

source
+ raw_text = true)

Save a universe from the path.

GU - The universe to save

path - Universe location

to_unload - Unload specific sets and parameters

raw_text - Denote if a universe is saved as raw_text or in a binary format.

source