Overview for developers

You can access the capabilities of the Tradeoff Analytics service via an HTTP Representational State Transfer (REST) API. Software Development Kits (SDKs) are also available to simplify application development in various languages. The following sections provide an overview of application development with the service.

Programming with the service

To use the Tradeoff Analytics service, you pass a decision problem to the HTTP POST dilemmas method of the service's API. You represent a decision problem as a JSON object. The following example shows how such a construct relates to the tabular representation of a simple problem.

Tradeoff Analytics API Example

The example includes two objectives specified via the columns parameter with keys obj1 and obj2. Each has a full_name that describes the objective, a type of numeric, and the boolean parameter is_objective set to true to indicate that the service is to evaluate each option against it. The goal of the first objective specifies that it is to be minimized (min), while that of the second indicates that it is to be maximized (max).

The JSON further specifies two options via the options parameter. Each option has a key and a name, and each includes values for both of the objectives. The image shows how the objectives and options specified in the JSON relate to the decision problem.

The service returns a Dilemma in the form of a JSON object that contains two constructs: the original problem and its resolution. The resolution includes solutions that describe how the options stack up against both the objectives and each other. By default, the resolution also includes a map with the parameters needed to represent the problem and its solutions on the two-dimensional visualization in the service's graphical interface.

The service makes its client interface available via a JavaScript library that provides a powerful web client with which users can explore and analyze the tradeoffs among the options. The library, referred to as the Tradeoff Analytics widget, is the recommended means of consuming the service's output. It is available from the Tradeoff Analytics Content Distribution Network (CDN).

Use of the interactive interface is optional, and an application can call the service without invoking the interface. The service can return just the results of its analysis without including the parameters needed for the interface and its visualization. For more information about working with the interactive interface, see Using the visualization interface and Programming with the widget.

Using Software Development Kits

The Tradeoff Analytics service supports a number of SDKs for simplified application development. The SDKs are available for many popular programming languages and platforms, including Node.js, Java, Python, and Apple® iOS. For a complete list of SDKs and information about using them, see Using Watson SDKs. All SDKs are available from the watson-developer-cloud namespace on GitHub.

The service also makes available the following sample applications to help you get started:

All SDKs support authenticating by using either your Bluemix® service credentials or an authentication token.

Learning more about application development

The Tradeoff Analytics service supports two typical programming models: Direct interaction, in which the client communicates with the service directly; and relaying via a proxy, in which the client and service exchange all data (requests and results) through a proxy application that resides in Bluemix®.

For more information about working with Watson Developer Cloud services and Bluemix, see the following: