Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    216938

Entry #2.71821182145904523

Sign in to follow this  
Mushu

126 views

  • Random observation of the day!
    No one really reads this, do they?

Anyways, I'm still working hard on my current project: CODENAME SKYNET!!!

I will now pull a Valve

Const e = 2.71828182845905

Public Function limiterFunc(weightedSum As Double, limiterFunction As Long) As Double
'this is the basic function that contains all the limiter
'functions. Put it in here to keep everything clutter-free.

Dim tmp As Double

Select Case limiterFunction
Case 0
'default function - step function

'if it's less than 0, return 0
If weightedSum <= 0 Then
limiter = 0
Exit Function

'if its greater than 0, return 1
ElseIf weightedSum > 0 Then
limiter = 1
Exit Function
End If

Case 1
'Sigmoid Function
tmp = 1 / (1 + e ^ (-1 * weightedSum))
'Debug.Print tmp
limiterFunc = tmp
'Debug.Print limiterFunc

Exit Function

Case Else
'something weird going on
Debug.Print "Invalid limiter function used..."
End Select
End Function



Have a nice day!
Sign in to follow this  


5 Comments


Recommended Comments

What do you mean 'pull a Valve'? Also, what is 'limiter'? Should it not be 'limiterFunc'?

Share this comment


Link to comment
Well, I read it. Ummm, red... Grrr.. There's no past tense of read that's different spelling then read. Hrmmm, I give up.

Share this comment


Link to comment
"Pull a Valve" = inadventently disclose source
"limiter..." = read next line - I didn't bother to put VB in the source tag; it's a comment

But wow... someone does read these.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!