This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This software is licensed under the Apache 2 license, quoted below. | |
Copyright 2014 Game Machine. | |
Copyright 2014 Chris Ochs <chris @ochsnet.com> | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
use this file except in compliance with the License. You may obtain a copy of | |
the License at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActorSystemRefs.ActorSystem.ActorOf(ClusterSingletonManager.Props( | |
singletonProps: Props.Create<ClusterSingletonActor>(), | |
terminationMessage: PoisonPill.Instance, | |
settings: ClusterSingletonManagerSettings.Create(ActorSystemRefs.ActorSystem)), | |
name: "manager"); | |
SystemActors.SingletonProxy = ActorSystemRefs.ActorSystem.ActorOf(ClusterSingletonProxy.Props( | |
singletonManagerPath: "/user/manager", | |
settings: ClusterSingletonProxySettings.Create(ActorSystemRefs.ActorSystem)), | |
name: "managerProxy"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int rngSeed = 123; // random number seed for reproducibility | |
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() | |
.seed(rngSeed) //include a random seed for reproducibility | |
// use stochastic gradient descent as an optimization algorithm | |
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT) | |
.iterations(1) | |
.learningRate(0.006) //specify the learning rate | |
.updater(org.deeplearning4j.nn.conf.Updater.NESTEROVS).momentum(0.9) //specify the rate of change of the learning rate. | |
.regularization(true).l2(1e-4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace GameCommon | |
{ | |
public class SpatialGrid | |
{ | |
public static Dictionary<string, SpatialGrid> Grids = new Dictionary<string, SpatialGrid>(); | |
private Dictionary<int, Dictionary<string, GridValue>> Cells = new Dictionary<int, Dictionary<string, GridValue>>(); | |
private Dictionary<string, GridValue> ObjectIndex = new Dictionary<string, GridValue>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Tree1 : IBtree | |
{ | |
[BtreeNode("test1")] | |
private BtreeNodeStatus Node1() | |
{ | |
return BtreeNodeStatus.Success; | |
} | |
[BtreeNode("test1")] | |
private BtreeNodeStatus Node2() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UltimateWater; | |
using UnityEngine; | |
namespace AiGame | |
{ | |
public class KinematicBuoyancy : MonoBehaviour | |
{ | |
public float DefaultHeight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
namespace AiGame | |
{ | |
public class GameObjectPool : MonoBehaviour | |
{ | |
public static Vector3 DefaultPosition = new Vector3(0f, 10000f, 0f); | |
public static GameObjectPool Instance; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Entities; | |
using Unity.Jobs; | |
using Unity.Mathematics; | |
using UnityEngine; | |
namespace AiGame.Ecs.Systems | |
{ | |
public class LosDirectSystem : JobComponentSystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using UnityEngine; | |
namespace Crest | |
{ | |
[System.Serializable] | |
public class CrestTimeProvider | |
{ | |
private const float MaxDifferenceBeforeAdjust = 0.5f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ClipBounds(float4 bounds, float2 pos) { | |
float2 min = bounds.xy; | |
float2 max = bounds.zw; | |
float a = step(min.x, pos.x); | |
float b = step(pos.x, max.x); | |
float c = step(min.y, pos.y); | |
float d = step(pos.y, max.y); | |
clip(3.0f - a - b - c - d); |