mirror of
https://github.com/simtactics/servo.git
synced 2025-03-15 00:21:20 +00:00
109 lines
No EOL
2.9 KiB
Text
109 lines
No EOL
2.9 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Decision Engine\n",
|
|
"\n",
|
|
"In The Sims 1, choices are based on a thresold which deteremines the priority for each type of object gets the most attention. This is based how much the sum of the current mood would be increased at that moment.\n",
|
|
"\n",
|
|
"In theory, it could be done with a lot of switches that map to each object, need and threshold, but that would be difficult to do in practice. Because The Sims was created before modern machine learning, Maxis created a custom AI engine for their game, known as SimAntics. \n",
|
|
"\n",
|
|
"Although an re-implementation of SimAntics exists with [FreeSO](https://github.com/riperiperi/FreeSO), it's tightly ingertated into the game. This experiment aims to create a open source and general purpose model using current machine learning technologies."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"#r \"nuget:Microsoft.ML\"\n",
|
|
"#r \"nuget:Microsoft.ML.AutoML\""
|
|
],
|
|
"outputs": [
|
|
{
|
|
"output_type": "execute_result",
|
|
"data": {
|
|
"text/plain": "Installed package Microsoft.ML.AutoML version 0.17.2"
|
|
},
|
|
"execution_count": 1,
|
|
"metadata": {}
|
|
},
|
|
{
|
|
"output_type": "execute_result",
|
|
"data": {
|
|
"text/plain": "Installed package Microsoft.ML version 1.5.2"
|
|
},
|
|
"execution_count": 1,
|
|
"metadata": {}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"using Microsoft.ML;\n",
|
|
"using Microsoft.ML.Data;\n",
|
|
"using Microsoft.ML.AutoML;\n",
|
|
"using System.IO;"
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"class NeedsInput {\n",
|
|
" [LoadColumn(0)] public string Action { get; set; }\n",
|
|
" [LoadColumn(1)] public string Need { get; set; }\n",
|
|
" [LoadColumn(2,3)] public float[] Threshold { get; set; }\n",
|
|
"}\n",
|
|
"\n",
|
|
"class NeedsOutput {\n",
|
|
" public int Score { get; set; }\n",
|
|
"}"
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"var dataPath = Path.Combine(Environment.CurrentDirectory, \"data\", \"choice.csv\");"
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"var ctx = new MLContext();\n",
|
|
"var trainingData = ctx.Data.LoadFromTextFile<NeedsInput>(dataPath, hasHeader: true);\n",
|
|
"var recSettings = new RecommendationExperimentSettings();"
|
|
],
|
|
"outputs": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": ".NET (C#)",
|
|
"language": "C#",
|
|
"name": ".net-csharp"
|
|
},
|
|
"language_info": {
|
|
"file_extension": ".cs",
|
|
"mimetype": "text/x-csharp",
|
|
"name": "C#",
|
|
"pygments_lexer": "csharp",
|
|
"version": "8.0"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
} |