spagnuolocarmine / ABM.jl

A Multi Agent Based Simulation engine in Julia language
MIT License
5 stars 0 forks source link

Update ABM API #1

Closed pszufe closed 5 years ago

pszufe commented 5 years ago

Chages include

pszufe commented 5 years ago

Additional comments:

  1. I have defined

    mutable struct Field2D{T<:Real,D<:Real} <: Field

perhaps

  mutable struct Field2D{T<:Real} <: Field 

could be enough I am not sure how you interpret the discretization parameter.

2.We have

struct Real2D{T<:Real} <: Position
    x::T
    y::T
end

struct Int2D <: Position
    x::Integer
    y::Integer
end

Int2D is obsolete - we could just use Real2D{Int} Note this means we probably can kick out the Position abstract type (unless you plan 3d positions to be within the same API - but then, if we wanted to have N-dimensional positions we should probably used StaticArrays).

spagnuolocarmine commented 5 years ago

Additional comments:

  1. I have defined mutable struct Field2D{T<:Real,D<:Real} <: Field

perhaps

  mutable struct Field2D{T<:Real} <: Field 

could be enough I am not sure how you interpret the discretization parameter.

2.We have

struct Real2D{T<:Real} <: Position
    x::T
    y::T
end

struct Int2D <: Position
    x::Integer
    y::Integer
end

Int2D is obsolete - we could just use Real2D{Int} Note this means we probably can kick out the Position abstract type (unless you plan 3d positions to be within the same API - but then, if we wanted to have N-dimensional positions we should probably used StaticArrays).

The discretization parameter defines the space of field, basically is the dimension of each single bucket. Absolutely we can remove Int2D, but leave Position also for Network field and d-Dimensional field.

Thank you