# Solution class

Namespace: [Grasshopper2.Doc](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.doc.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Solution
```

Maintains a set of methods and properties which are used by IDocumentObjects while computing new solution data.

## Constructors

- [Solution](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/ctor.md): (2 overloads) Create a new solution with an existing cancellation source.

## Properties

- [Age](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/age.md): Gets the age of this solution. Note that a solution never stops aging, even after it completes.
- [ComputableCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/computablecount.md): Gets the total number of expired, cancelled or faulted objects that will be solved as part of this solution.
- [Document](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/document.md): Gets the document associated with this solution. Note that this may be a different document from the one which hosts whatever object is given this Solution instance.
- [Id](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/id.md): Gets the solution identifier.
- [InvalidParameters](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/invalidparameters.md): Gets the number of invalid parameters recorded in this solution.
- [Mode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/mode.md): Gets the mode this solution is running in.
- [OverallProgress](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/overallprogress.md): Gets the overall progress of the solution. This property does a fair amount of heavy lifting, so try not to call it too often, there's a good boy...
- [Phase](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/phase.md): Gets the state this solution is currently in.
- [Time](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/time.md): Gets the time (in UTC coordinates) when this solution began.
- [Token](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/token.md): Gets the cancellation token associated with this solution. The IsCancelRequested property and Cancel method are the fastest way to determine/trigger cancellation state, but you can use the Token to pass to Tasks that require one.

## Methods

- [Cancel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/cancel.md): Move the solution into the Cancelled state.
- [Cancelled](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/cancelled.md): (obsolete)
- [HashParameter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/hashparameter.md): Hash the volatile data inside a parameter and store that hash locally in this solution. Any subsequent calls to this method with the same parameter will record whether the hash has changed. This method only works when the [Solution.Mode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/mode.md) equals either [SolutionMode.Validating](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solutionmode.md) or [SolutionMode.ValidatingSafe](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solutionmode.md).
- [IsParameterHashValid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/isparameterhashvalid.md): Test whether the given parameter is considered valid. This method only makes sense once the solution has completed, and when the [Solution.Mode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/mode.md) equals either [SolutionMode.Validating](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solutionmode.md) or [SolutionMode.ValidatingSafe](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solutionmode.md).
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/tostring.md): Get a string representation of this solution.

## Events

- [StateChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/statechanged.md): Raised whenever the [Solution.Phase](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.solution/phase.md) of this solution changes.
