Skip to content

Instantly share code, notes, and snippets.

View Hsgngr's full-sized avatar
🎯
Focusing

Ege Hoşgüngör Hsgngr

🎯
Focusing
View GitHub Profile
@Hsgngr
Hsgngr / C#
Created July 3, 2020 23:31
PandemicArea.cs
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
/// Manages spawning bots and market
/// </summary>
public class PandemicArea : MonoBehaviour
{
[Tooltip("Range of the area")]
@Hsgngr
Hsgngr / C#
Created July 3, 2020 23:50
dummyBot.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// Manages a single DummyBot who acts randomly on the environment.
/// </summary>
public class DummyBot : MonoBehaviour
{
@Hsgngr
Hsgngr / PandemicArea.cs
Last active July 28, 2020 10:40
PandemicArea.cs with healthy, infected, recovered counters
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
/// Manages spawning bots and market
/// </summary>
public class PandemicArea : MonoBehaviour
{
[Tooltip("Range of the area")]
@Hsgngr
Hsgngr / ExportCsv.cs
Created July 28, 2020 10:21
Exporting the data to csv from Unity
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
public class ExportCsv : MonoBehaviour
{
public StringBuilder sb = new System.Text.StringBuilder();
@Hsgngr
Hsgngr / DummyBot.cs
Created July 28, 2020 10:46
ChangeAgentStatus() of DummyBot.cs
public void changeAgentStatus()
{
switch (m_InfectionStatus)
{
case agentStatus.HEALTHY:
GetComponentInChildren<Renderer>().material = healthyMaterial;
break;
case agentStatus.INFECTED:
GetComponentInChildren<Renderer>().material = infectiousMaterial;
pandemicAreaObj.GetComponent<PandemicArea>().healthyCounter--;
@Hsgngr
Hsgngr / SIRGraph.py
Created July 28, 2020 13:43
SIR Graph script
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 20 13:41:07 2020
@author: Ege
"""
# Importing the libraries
import seaborn as sns
import pandas as pd
@Hsgngr
Hsgngr / PandemicAgent.cs
Last active September 4, 2020 11:31
Pandemic Agent Script
using System.Collections;
using System.Collections.Generic;
using Unity.MLAgents;
using Unity.MLAgents.Sensors;
using UnityEngine;
/// <summary>
/// A Pandemic Simulation Machine Learning Agent
/// </summary>
public class PandemicAgent : Agent
@Hsgngr
Hsgngr / PandemicArea.cs
Created September 4, 2020 12:02
PandemicArea script with mlagents integration
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using Unity.Barracuda;
using Unity.MLAgents;
using UnityEngine;
/// <summary>
/// Manages spawning bots and market
/// </summary>
@Hsgngr
Hsgngr / reward.cs
Last active September 4, 2020 12:58
Reward script for PandemicSimulation
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class reward : MonoBehaviour
{
private GameObject pandemicAreaObj;
//private bool isTaken = false;
@Hsgngr
Hsgngr / .ipynb
Created July 14, 2021 15:43
Tf-Agents Trading Notebook Fails
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",