Skip to content

Suite of examples of globalMOO API implementations for optimization and inverse solution across a wide variety of language-specific SDKs

License

Notifications You must be signed in to change notification settings

globalMOO/gmoo-sdk-suite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

globalMOO SDK Example Suite

MIT License

This repository contains a comprehensive suite of examples demonstrating how to use the globalMOO optimization SDK across multiple programming languages. Each language-specific directory provides step-by-step guides and sample implementations to help you integrate globalMOO into your projects.

What is globalMOO?

globalMOO is a powerful multi-objective optimization platform designed to solve complex inverse problems. It allows you to:

  • Find optimal input parameters that achieve desired output targets
  • Work with mixed variable types (continuous, integer, boolean, categorical)
  • Define different types of optimization objectives
  • Solve problems that would be difficult or impossible with traditional methods

The platform is particularly valuable for engineering, scientific, financial, and AI applications where you need to determine input values that produce specific output results.

Language SDKs

Each language-specific SDK directory contains its own detailed README, installation instructions, and a consistent set of examples demonstrating key globalMOO capabilities:

Our Python SDK provides a clean, Pythonic interface to the globalMOO API, with support for the latest Python features and patterns. To quickly see the Python SDK in action, check out the interactive in-browser implementation. It also includes a webhook example for setting up a client-side server to handle API events.

# Example: Simple linear optimization with Python
from globalmoo.client import Client
from globalmoo.request.load_objectives import LoadObjectives
from globalmoo.enums.objective_type import ObjectiveType

client = Client()
objective = client.execute_request(LoadObjectives(
    trial_id=trial_id,
    objectives=[2.0, 3.0, 3.0],
    objective_types=[ObjectiveType.PERCENT, ObjectiveType.PERCENT, ObjectiveType.PERCENT],
    # Additional parameters...
))

Our JavaScript SDK provides a modern, Promise-based interface with full support for async/await patterns and ES modules.

// Example: Simple linear optimization with JavaScript
import { Client, LoadObjectives, ObjectiveType } from '@globalmoo/globalmoo-sdk';

const client = new Client();
const objective = await client.executeRequest(
  new LoadObjectives({
    trialId: trial.id,
    objectives: [2.0, 3.0, 3.0],
    objectiveTypes: Array(3).fill(ObjectiveType.PERCENT),
    // Additional parameters...
  })
);

Our C# SDK provides a strongly-typed, async-first interface that follows modern .NET conventions and best practices.

// Example: Simple linear optimization with C#
using GMOO.SDK;
using GMOO.SDK.Enums;

var client = new Client();
var objective = await client.LoadObjectivesAsync(
    trialId: trial.Id,
    objectives: new List<double> { 2.0, 3.0, 3.0 },
    objectiveTypes: Enumerable.Repeat(ObjectiveType.Percent, 3).ToList(),
    // Additional parameters...
);

Our PHP SDK implements a modern, object-oriented interface compatible with PHP 8+, featuring strong typing and a consistent API surface.

// Example: Simple linear optimization with PHP
$client = new \GlobalMoo\Client();
$objective = $client->loadObjectives(
    new LoadObjectives(
        trialId: $trial->id,
        objectives: $targetValues,
        objectiveTypes: [ObjectiveType::Percent, ObjectiveType::Percent, ObjectiveType::Percent],
        // Additional parameters...
    )
);

Example Types

All SDKs implement a consistent set of examples that demonstrate key globalMOO capabilities:

  • Linear - Linear system of equations with 3 inputs and 5 outputs
  • Simple - Basic nonlinear 3-input, 3-output quadratic function example
  • Integer - Example demonstrating integer variable optimization
  • Logical - Example showing boolean variable optimization
  • Categorical - Example with categorical variable handling
  • Exact Objective - High-precision optimization with exact L1-convergence
  • Multiple Objective Types - Mixed objective types in a single model
  • Multiple Outcome - Working with subsets of model outputs
  • Complex - Advanced example with mixed variable types and constraints
  • Convolutional - Finding multiple valid solutions for underdetermined systems
  • Constrained Maximization - Maximizing an objective while respecting constraints that exclude the global maximum

Additionally, the Python SDK includes a Webhook Example that demonstrates how to set up a client-side server for running models interactively via the API dashboard. This implementation enables event-driven optimization workflows where your model function is automatically called in response to platform events.

Getting Started

  1. Navigate to the directory for your preferred language
  2. Follow the language-specific installation instructions
  3. Configure your environment with your API credentials:
    • Set GMOO_API_KEY to your globalMOO API key
    • Set GMOO_API_URI to https://app.globalmoo.com/api/
  4. Run the examples to see globalMOO in action
  5. Use the examples as templates for your own optimization problems

Documentation

For comprehensive documentation and API reference, visit our globalMOO Documentation.

This documentation includes:

  • Complete API reference
  • SDK installation and setup guides
  • Detailed usage examples
  • Optimization concepts and best practices
  • Troubleshooting and FAQ

Support

For support, please contact [email protected] or visit our website.

License

This SDK example suite is licensed under the MIT License - see the individual SDK directories for details.

About

Suite of examples of globalMOO API implementations for optimization and inverse solution across a wide variety of language-specific SDKs

Resources

License

Stars

Watchers

Forks

Packages

No packages published