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.
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.
The example includes two objectives specified via the
columns parameter with
and obj2. Each has a
full_name that describes
the objective, a
type of numeric, and the boolean
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
parameter. Each option has a
key and a
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
solutions that describe how the options stack up against
both the objectives and each other. By default, the
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.
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.
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:
You can access an application that uses the Node.js SDK at the tradeoff-analytics-nodejs repository.
You can access an application that uses the Java SDK at the tradeoff-analytics-java repository.
All SDKs support authenticating by using either your Bluemix® service credentials or an authentication token.
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:
For an introduction to working with Watson services and Bluemix, see Getting started with Watson Developer Cloud and Bluemix.
For a language-independent introduction to developing Watson services applications in Bluemix, see Developing Watson applications with Bluemix.
For information about the two programming models available for developing Watson applications, see Programming models for Watson services:
With relaying via a proxy, the client relies on a proxy server that resides in Bluemix to communicate with the service; it passes all requests through the proxy application. Relaying requests via a proxy relies only on service credentials to authenticate with the service; see Obtaining credentials for Watson services.
With direct interaction, the client uses the proxy application in Bluemix only to obtain an authentication token for the service, after which it communicates directly with the service. Direct interaction uses service credentials only to obtain a token; see Using tokens with Watson services.
For information about controlling the default request logging that is performed for all Watson services, see Controlling request logging for Watson services.