Skip to content

Commit

Permalink
updated api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
caesuric committed May 22, 2024
1 parent 55cd22c commit 6f0aa93
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 24 deletions.
2 changes: 2 additions & 0 deletions api-docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

[ComparisonValuePair](./mountaingoap.comparisonvaluepair.md)

[DictionaryExtensionMethods](./mountaingoap.dictionaryextensionmethods.md)

[ExecutionStatus](./mountaingoap.executionstatus.md)

[ExtremeGoal](./mountaingoap.extremegoal.md)
Expand Down
24 changes: 12 additions & 12 deletions api-docs/mountaingoap.action.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ Key for the value to be retrieved.
[Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)<br>
The value stored at the key specified.

### **GetCost(Dictionary&lt;String, Object&gt;)**
### **GetCost(ConcurrentDictionary&lt;String, Object&gt;)**

Gets the cost of the action.

```csharp
public float GetCost(Dictionary<string, object> currentState)
public float GetCost(ConcurrentDictionary<string, object> currentState)
```

#### Parameters

`currentState` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
`currentState` ConcurrentDictionary&lt;String, Object&gt;<br>
State as it will be when cost is relevant.

#### Returns
Expand All @@ -186,53 +186,53 @@ Agent executing the action.
[ExecutionStatus](./mountaingoap.executionstatus.md)<br>
The execution status of the action.

### **IsPossible(Dictionary&lt;String, Object&gt;)**
### **IsPossible(ConcurrentDictionary&lt;String, Object&gt;)**

Determines whether or not an action is possible.

```csharp
internal bool IsPossible(Dictionary<string, object> state)
internal bool IsPossible(ConcurrentDictionary<string, object> state)
```

#### Parameters

`state` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
`state` ConcurrentDictionary&lt;String, Object&gt;<br>
The current world state.

#### Returns

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
True if the action is possible, otherwise false.

### **GetPermutations(Dictionary&lt;String, Object&gt;)**
### **GetPermutations(ConcurrentDictionary&lt;String, Object&gt;)**

Gets all permutations of parameters possible for an action.

```csharp
internal List<Dictionary<string, object>> GetPermutations(Dictionary<string, object> state)
internal List<Dictionary<string, object>> GetPermutations(ConcurrentDictionary<string, object> state)
```

#### Parameters

`state` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
`state` ConcurrentDictionary&lt;String, Object&gt;<br>
World state when the action would be performed.

#### Returns

[List&lt;Dictionary&lt;String, Object&gt;&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)<br>
A list of possible parameter dictionaries that could be used.

### **ApplyEffects(Dictionary&lt;String, Object&gt;)**
### **ApplyEffects(ConcurrentDictionary&lt;String, Object&gt;)**

Applies the effects of the action.

```csharp
internal void ApplyEffects(Dictionary<string, object> state)
internal void ApplyEffects(ConcurrentDictionary<string, object> state)
```

#### Parameters

`state` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
`state` ConcurrentDictionary&lt;String, Object&gt;<br>
World state to which to apply effects.

### **SetParameters(Dictionary&lt;String, Object&gt;)**
Expand Down
10 changes: 5 additions & 5 deletions api-docs/mountaingoap.actionnode.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)
Gets or sets the state of the world for this action node.

```csharp
public Dictionary<string, object> State { get; set; }
public ConcurrentDictionary<string, object> State { get; set; }
```

#### Property Value

[Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
ConcurrentDictionary&lt;String, Object&gt;<br>

### **Parameters**

Expand Down Expand Up @@ -99,17 +99,17 @@ public int GetHashCode()

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>

### **Cost(Dictionary&lt;String, Object&gt;)**
### **Cost(ConcurrentDictionary&lt;String, Object&gt;)**

Cost to traverse this node.

```csharp
internal float Cost(Dictionary<string, object> currentState)
internal float Cost(ConcurrentDictionary<string, object> currentState)
```

#### Parameters

`currentState` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
`currentState` ConcurrentDictionary&lt;String, Object&gt;<br>
Current state after previous node is executed.

#### Returns
Expand Down
14 changes: 7 additions & 7 deletions api-docs/mountaingoap.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public string Name;

### **CurrentActionSequences**

Gets or sets the chains of actions currently being performed by the agent.
Gets the chains of actions currently being performed by the agent.

```csharp
public List<List<Action>> CurrentActionSequences { get; set; }
public List<List<Action>> CurrentActionSequences { get; }
```

#### Property Value
Expand All @@ -39,12 +39,12 @@ public List<List<Action>> CurrentActionSequences { get; set; }
Gets or sets the current world state from the agent perspective.

```csharp
public Dictionary<string, object> State { get; set; }
public ConcurrentDictionary<string, object> State { get; set; }
```

#### Property Value

[Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
ConcurrentDictionary&lt;String, Object&gt;<br>

### **Memory**

Expand Down Expand Up @@ -132,20 +132,20 @@ public bool IsPlanning { get; set; }
## Constructors

### **Agent(String, Dictionary&lt;String, Object&gt;, Dictionary&lt;String, Object&gt;, List&lt;BaseGoal&gt;, List&lt;Action&gt;, List&lt;Sensor&gt;, Single)**
### **Agent(String, ConcurrentDictionary&lt;String, Object&gt;, Dictionary&lt;String, Object&gt;, List&lt;BaseGoal&gt;, List&lt;Action&gt;, List&lt;Sensor&gt;, Single)**

Initializes a new instance of the [Agent](./mountaingoap.agent.md) class.

```csharp
public Agent(string name, Dictionary<string, object> state, Dictionary<string, object> memory, List<BaseGoal> goals, List<Action> actions, List<Sensor> sensors, float costMaximum)
public Agent(string name, ConcurrentDictionary<string, object> state, Dictionary<string, object> memory, List<BaseGoal> goals, List<Action> actions, List<Sensor> sensors, float costMaximum)
```

#### Parameters

`name` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
Name of the agent.

`state` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
`state` ConcurrentDictionary&lt;String, Object&gt;<br>
Initial agent state.

`memory` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
Expand Down
122 changes: 122 additions & 0 deletions api-docs/mountaingoap.dictionaryextensionmethods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# DictionaryExtensionMethods

Namespace: MountainGoap

Extension method to copy a dictionary of strings and objects.

```csharp
public static class DictionaryExtensionMethods
```

Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [DictionaryExtensionMethods](./mountaingoap.dictionaryextensionmethods.md)
## Methods

### **Add(ConcurrentDictionary&lt;String, Object&gt;, String, Object)**

Add functionality for ConcurrentDictionary.

```csharp
public static void Add(ConcurrentDictionary<string, object> dictionary, string key, object value)
```

#### Parameters

`dictionary` ConcurrentDictionary&lt;String, Object&gt;<br>
Dictionary to which to add an item.

`key` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
Key to add.

`value` [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)<br>
Value to add.

### **Copy(Dictionary&lt;String, Object&gt;)**

Copies the dictionary to a shallow clone.

```csharp
internal static Dictionary<string, object> Copy(Dictionary<string, object> dictionary)
```

#### Parameters

`dictionary` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
Dictionary to be copied.

#### Returns

[Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
A shallow copy of the dictionary.

### **Copy(ConcurrentDictionary&lt;String, Object&gt;)**

Copies the concurrent dictionary to a shallow clone.

```csharp
internal static ConcurrentDictionary<string, object> Copy(ConcurrentDictionary<string, object> dictionary)
```

#### Parameters

`dictionary` ConcurrentDictionary&lt;String, Object&gt;<br>
Dictionary to be copied.

#### Returns

ConcurrentDictionary&lt;String, Object&gt;<br>
A shallow copy of the dictionary.

### **Copy(Dictionary&lt;String, ComparisonValuePair&gt;)**

Copies the dictionary to a shallow clone.

```csharp
internal static Dictionary<string, ComparisonValuePair> Copy(Dictionary<string, ComparisonValuePair> dictionary)
```

#### Parameters

`dictionary` [Dictionary&lt;String, ComparisonValuePair&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
Dictionary to be copied.

#### Returns

[Dictionary&lt;String, ComparisonValuePair&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
A shallow copy of the dictionary.

### **Copy(Dictionary&lt;String, String&gt;)**

Copies the dictionary to a shallow clone.

```csharp
internal static Dictionary<string, string> Copy(Dictionary<string, string> dictionary)
```

#### Parameters

`dictionary` [Dictionary&lt;String, String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
Dictionary to be copied.

#### Returns

[Dictionary&lt;String, String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
A shallow copy of the dictionary.

### **CopyNonNullable(Dictionary&lt;String, Object&gt;)**

Copies the dictionary to a shallow clone.

```csharp
internal static Dictionary<string, object> CopyNonNullable(Dictionary<string, object> dictionary)
```

#### Parameters

`dictionary` [Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
Dictionary to be copied.

#### Returns

[Dictionary&lt;String, Object&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br>
A shallow copy of the dictionary.

0 comments on commit 6f0aa93

Please sign in to comment.