Search found 6 matches

by mkbonde
2 months ago
Forum: Tools
Topic: Make a noise in GAMS
Replies: 2
Views: 986

Re: Make a noise in GAMS

You could also use the embedded code feature to run a python snippet - there are a bunch of text to speech libraries out there.

Code: Select all

$onEmbeddedCode Python:
    import pyttsx3
    engine = pyttsx3.init()
    engine.say("I will speak this text")
    engine.runAndWait()
$offEmbeddedCode
by mkbonde
4 months ago
Forum: Modeling
Topic: Different indexing for same variable
Replies: 7
Views: 774

Re: Different indexing for same variable

Your example can written as a sum: sum(f, generation[f] * fuel_price[f]) where f is a set containing your different fuel types such as gas and oil. You can also insert the set elements directly, for example: generation["oil"] * fuel_price["oil"] + generation["gas"] * fuel_price["gas"]. Does this sol...
by mkbonde
1 year ago
Forum: API
Topic: GMSPython 3.7 and tkinter
Replies: 2
Views: 1777

Re: GMSPython 3.7 and tkinter

That is very reasonable and we will probably end up using Miniconda to help our clients. I only ask in case you were already planning on updating the interpreter soon (since you recently added support for Python 3.7). Most packages today can be easily installed using pip making it easy to build on t...
by mkbonde
1 year ago
Forum: API
Topic: GMSPython 3.7 and tkinter
Replies: 2
Views: 1777

GMSPython 3.7 and tkinter

What is the timeline for updating the Python installation that comes with GAMS? As of version 3.7, the standard Python installation on Windows comes with tkinter. Will that also be the case for the version shipped with GAMS in future releases? (It would be very convenient if our clients had access t...
by mkbonde
1 year ago
Forum: Modeling
Topic: Indexing a Set with multiple values
Replies: 2
Views: 744

Re: Indexing a Set with multiple values

You can compare the positions of the two elements in their respective sets by writing

Code: Select all

$(ord(cereq)=ord(t))
or compare the position of cereq with the value of t:

Code: Select all

$(ord(cereq)=t.val)
Using .val is useful when comparing numerical sets that don't naturally start at 1, for example years.
by mkbonde
1 year ago
Forum: Wishes
Topic: Support larger character set for identifiers
Replies: 0
Views: 1172

Support larger character set for identifiers

Would it be possible to add support for more than alphanumeric characters for identifiers in a future release? Both Python and Julia allow many non-ASCII characters in identifiers, e.g. the following is valid python code: β = [1, 2, 3] def Σ(iter): return sum(iter) print(Σ(β)) For most programming I...