sarl / sarl Goto Github PK
View Code? Open in Web Editor NEWSARL Agent-Oriented Programming Language http://www.sarl.io
License: Apache License 2.0
SARL Agent-Oriented Programming Language http://www.sarl.io
License: Apache License 2.0
AgentSpawned, agentID:e0c5f429-3470-4adf-a100-d7c47770c904 AgentType: class io.sarl.demos.filesearch.FileSearchAgent
[ID=e7777b8c-89c6-40c7-8aff-537462480f33 - parent e0c5f429-3470-4adf-a100-d7c47770c904] Searching in null file matching .sarl created before Fri Mar 21 18:24:20 CET 2014
mars 21, 2014 6:24:22 PM io.janusproject.kernel.AgentEventBusSubscriberExceptionHandler handleException
Grave: SUBSCRIBER_ERROR
java.lang.NullPointerException
at java.io.File.(File.java:277)
at io.sarl.demos.filesearch.FileSearchAgent._handle_Search_2(FileSearchAgent.java:252)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:332)
at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34)
at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
java.lang.NullPointerException
at java.io.File.(File.java:277)
at io.sarl.demos.filesearch.FileSearchAgent._handle_Search_2(FileSearchAgent.java:252)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:332)
at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34)
at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
When opening the SARL documentation on www.sarl.io, we can see the "Spec" and "Source" tabs.
The meaning of "Source" may be ambiguous because the visitor may consider that it contains the source code of the tutorial example. She/he may be disappointed to obtain the code of the documentation specification (e.g. oral comment by @gbasso).
Is it possible to change the skin of the SARL documentation to avoid this problem?
It is very difficult to create a project from scratch from the given guidelines on the SARL website.
The following things are missed:
With :
event AgentSpawned {
var agentID :UUID
}
event MyAgentSpawned extends AgentSpawned { // no highlighted error
var titi : UUID
}
In agent :
agent MyAgent {
on MyAgentSpawned {
occurrence.titi // okay
occurrence.agentID // error, not found
}
}
Also, the following code is generated :
public class CreatorAgentSpawned extends Event {
Main class: io.janusproject.Boot
Network parameters:
-Dnetwork.encrypter.aes.key=ENCRYPTATIONKEY
-Dnetwork.pub.uri=tcp://MYIP:PORT
Default port: 19118
A variable is declared as
var String s = "xx"
while an action return type is declared with:
def myString : String {
"xx"
}
This should be unified.
When launching the Eclipse product for Linux x64, I obtain "OutOfMemoryError", and Eclipse does not start.
When installed Eclipse for Java Developer and SARL from the update site, Eclipse is started fine.
Attribute and XVariableDeclaration have the same definition. We should have only one for both.
At the moments one can not declare varargs parameters in the signature of actions (used in capacity, agents,etc)
We should be able to declare
def myAction(String... params)
Instead of
def myAction(String[] params)
I want to use ctrl+clic
in eclipse to access to source code of SARL.
According to my understanding of the language semantic, a function should be provided by an import or a capacity when it is not a keyword.
But, if I take a look on the FileSearch demo, the "println" function seems to not be provided by an import (as "format") nor a capacity (as "wake").
Assuming there is no "hidden" import, if we decide that this function is always available, it may be a keyword.
At the end, is it a problem of syntax highlighting?
I define two capacities, which have an inheritance link:
capacity AbctractEnvironmentCapacity {
def getBodyFactory : AgentBodyFactory
}
capacity Environment3D extends AbctractEnvironmentCapacity {
def spawnBody(body : AgentBody<Influence3D,Perception3D>)
}
Then, I define an agent that should be able to interact with the environment through the capacity Environment3D
:
agent Carpooler {
uses Environment3D
on Initialize {
var factory = bodyFactory
}
}
The functions bodyFactory
and getBodyFactory
are not found (compilation error).
When I move the definition of getBodyFactory
from AbctractEnvironmentCapacity
into Environment3D
, the compilation error is disappearing.
In the constructor of a skill, the agent owner must be given as a parameter. Otherwise an error occurs in the java code.
This information is not given and this obligation is quite weird. Could it be done in the setSkill
function ?
The ownership is not set at the creation time but at the association time (when the setSkill
function is called)
The first line is :
"This document defines who to declare events in SARL."
I think it should be :
"This document defines how to declare events in SARL."
The original issue is sarl/sarl.github.io#2.
Define a complete graphic charter for communication purposes and associated websites
This is just for convenience.
As JAVA and SARL languages are quite similar, it is difficult to switch between the two languages during development.
mars 21, 2014 6:24:21 PM io.janusproject.kernel.BehaviorsAndInnerContextSkill$AgentEventListener receiveEvent
Avertissement: Un événement a été ignoré durant la destruction de l'agent : MemberLeft[source = Address [agentId=9e5862e6-1a81-4612-9a03-34b9fff746e3, spaceId=SpaceID [id=b99718be-ca8c-42b5-bd80-017ea994cc44, contextID=4940b9e4-9d79-4a4b-9c57-3fa812ec148c, spaceSpec=interface io.sarl.lang.core.EventSpaceSpecification]]agentID = 9e5862e6-1a81-4612-9a03-34b9fff746e3]
mars 21, 2014 6:24:21 PM io.janusproject.kernel.EventSpaceImpl emit
Grave: null
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:1016)
at java.util.Collections$SetFromMap.contains(Collections.java:3901)
at io.sarl.util.AddressScope.matches(AddressScope.java:55)
at io.sarl.util.AddressScope.matches(AddressScope.java:33)
at io.janusproject.kernel.EventSpaceImpl.doEmit(EventSpaceImpl.java:142)
at io.janusproject.kernel.EventSpaceImpl.emit(EventSpaceImpl.java:126)
at io.sarl.demos.filesearch.FileSearchAgent._handle_Search_2(FileSearchAgent.java:300)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:332)
at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34)
at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:1016)
at java.util.Collections$SetFromMap.contains(Collections.java:3901)
at io.sarl.util.AddressScope.matches(AddressScope.java:55)
at io.sarl.util.AddressScope.matches(AddressScope.java:33)
at io.janusproject.kernel.EventSpaceImpl.doEmit(EventSpaceImpl.java:142)
at io.janusproject.kernel.EventSpaceImpl.emit(EventSpaceImpl.java:126)
at io.sarl.demos.filesearch.FileSearchAgent._handle_Search_2(FileSearchAgent.java:300)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:332)
at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34)
at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Because the use of Maven for installing SARL may be a drawback for a part of the users, it should be restrict to the developers of SARL.
For the other users, we should deploy the Eclipse features on a web browser as soon as possible.
It may be useful to specify default values for the parameters:
def myAction(String a, int b=35) {
}
SARL generator should create events with a hashCode and equals methods on the java side.
Sometimes after a crash or a hard kill of the application, we have an Hazelcast connection problem that prevents the initialization from finishing and block the execution before agent initialize
mars 21, 2014 6:10:10 PM com.hazelcast.partition.PartitionService
Infos: [10.20.2.144]:5701 [dev] Re-partitioning cluster data... Migration queue size: 135
mars 21, 2014 6:10:12 PM com.hazelcast.partition.PartitionService
Infos: [10.20.2.144]:5701 [dev] All migration tasks has been completed, queues are empty.
mars 21, 2014 6:10:33 PM com.hazelcast.nio.TcpIpConnection
Infos: [10.20.2.144]:5701 [dev] Connection [Address[10.20.2.144]:5702] lost. Reason: java.io.EOFException[Remote socket closed!]
mars 21, 2014 6:10:33 PM com.hazelcast.nio.ReadHandler
Avertissement: [10.20.2.144]:5701 [dev] hz._hzInstance_1_dev.IO.thread-in-0 Closing socket to endpoint Address[10.20.2.144]:5702, Cause:java.io.EOFException: Remote socket closed!
mars 21, 2014 6:10:34 PM com.hazelcast.nio.SocketConnector
Infos: [10.20.2.144]:5701 [dev] Connecting to /10.20.2.144:5702, timeout: 0, bind-any: true
mars 21, 2014 6:10:34 PM com.hazelcast.nio.SocketConnector
Infos: [10.20.2.144]:5701 [dev] Could not connect to: /10.20.2.144:5702. Reason: SocketException[Connexion refusée to address /10.20.2.144:5702]
mars 21, 2014 6:10:35 PM com.hazelcast.nio.SocketConnector
Infos: [10.20.2.144]:5701 [dev] Connecting to /10.20.2.144:5702, timeout: 0, bind-any: true
mars 21, 2014 6:10:35 PM com.hazelcast.nio.SocketConnector
Infos: [10.20.2.144]:5701 [dev] Could not connect to: /10.20.2.144:5702. Reason: SocketException[Connexion refusée to address /10.20.2.144:5702]
mars 21, 2014 6:10:36 PM com.hazelcast.nio.SocketConnector
Infos: [10.20.2.144]:5701 [dev] Connecting to /10.20.2.144:5702, timeout: 0, bind-any: true
mars 21, 2014 6:10:36 PM com.hazelcast.nio.SocketConnector
Infos: [10.20.2.144]:5701 [dev] Could not connect to: /10.20.2.144:5702. Reason: SocketException[Connexion refusée to address /10.20.2.144:5702]
mars 21, 2014 6:10:36 PM com.hazelcast.nio.ConnectionMonitor
Avertissement: [10.20.2.144]:5701 [dev] Removing connection to endpoint Address[10.20.2.144]:5702 Cause => java.net.SocketException {Connexion refusée to address /10.20.2.144:5702}, Error-Count: 5
mars 21, 2014 6:10:36 PM com.hazelcast.cluster.ClusterService
Infos: [10.20.2.144]:5701 [dev] Removing Member [10.20.2.144]:5702
mars 21, 2014 6:10:36 PM com.hazelcast.cluster.ClusterService
Infos: [10.20.2.144]:5701 [dev]
Members [1] {
Member [10.20.2.144]:5701 this
}
mars 21, 2014 6:10:36 PM com.hazelcast.partition.PartitionService
Infos: [10.20.2.144]:5701 [dev] Partition balance is ok, no need to re-partition cluster data...
Some errors occur in generated java code and do not appear in SARL code. I think that the highlight of such errors is really important in a SARL code.
e.g.:
capacity ComputeEnergyCapacity {
def getEnergy : Double
}
skill FuelCellSkill implements ComputeEnergyCapacity {
}
In java:
The type FuelCellSkill must implement the inherited abstract method ComputeEnergyCapacity.getEnergy()
I want to create a generic agent which choose its skill from an external data (e.g. an enum):
setSkill(MyOwnCapacity, SkillFactory.createSkill(data) )
The createSkill
function is defined as follow:
public static Skill createSkill(DataEnum data) {
Skill res = null;
switch (data) {
case CASE1:
res = (Skill) new MyOwnSkill1();
break;
case CASE2:
res = (Skill) new MyOwnSkill2();
break;
default:
break;
}
return res;
}
To be full comprehensive I also give the definition of the skills and capacity:
capacity MyOwnCapacity {
def myFunc : Double
}
skill MyOwnSkill1 implements MyOwnCapacity {
def myFunc : Double {
return 0d
}
}
skill MyOwnSkill2 implements MyOwnCapacity {
def myFunc : Double {
return 1d
}
}
How can I be as generic as I want ?
The generic of the setSkill
function: <S extends Skill & Capacity>
could be a limitation for this.
When launching the HelloAgent demo, the kernel does not stop.
Lancement de l'agent : fr.utbm.set.demo.HelloAgent
mars 11, 2014 5:55:31 PM com.hazelcast.instance.DefaultAddressPicker
Infos: Prefer IPv4 stack is true.
mars 11, 2014 5:55:31 PM com.hazelcast.instance.DefaultAddressPicker
Infos: Picked Address[10.85.0.179]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
mars 11, 2014 5:55:31 PM com.hazelcast.system
Infos: [10.85.0.179]:5701 [dev] Hazelcast Community Edition 3.1.5 (20140115) starting at Address[10.85.0.179]:5701
mars 11, 2014 5:55:31 PM com.hazelcast.system
Infos: [10.85.0.179]:5701 [dev] Copyright (C) 2008-2013 Hazelcast.com
mars 11, 2014 5:55:31 PM com.hazelcast.instance.Node
Infos: [10.85.0.179]:5701 [dev] Creating MulticastJoiner
mars 11, 2014 5:55:31 PM com.hazelcast.core.LifecycleService
Infos: [10.85.0.179]:5701 [dev] Address[10.85.0.179]:5701 is STARTING
mars 11, 2014 5:55:41 PM com.hazelcast.cluster.MulticastJoiner
Infos: [10.85.0.179]:5701 [dev]
Members [1] {
Member [10.85.0.179]:5701 this
}
mars 11, 2014 5:55:41 PM com.hazelcast.core.LifecycleService
Infos: [10.85.0.179]:5701 [dev] Address[10.85.0.179]:5701 is STARTED
mars 11, 2014 5:55:42 PM com.hazelcast.partition.PartitionService
Infos: [10.85.0.179]:5701 [dev] Initializing cluster partition table first arrangement...
mars 11, 2014 5:55:42 PM io.janusproject.repository.KernelRepositoryService$NetworkListener starting
Infos: Démarrage de Hazelcast
mars 11, 2014 5:55:42 PM io.janusproject.repository.KernelRepositoryService$NetworkListener running
Infos: Début de l'initialisation d'Hazelcast
mars 11, 2014 5:55:42 PM io.janusproject.repository.KernelRepositoryService$NetworkListener running
Infos: Fin de l'initialisation d'Hazelcast
Hello World!
Goodbye World!
mars 11, 2014 5:55:44 PM io.janusproject.kernel.SpawnService killAgent
Grave: Requête d'arrêt du noyau
mars 11, 2014 5:55:44 PM io.janusproject.kernel.Kernel stop
Infos: Arrêt des services du noyau
When launching a second instance of the demo the following log appears in the console of the first instance, just after the previous logs :
mars 11, 2014 5:56:01 PM com.hazelcast.nio.SocketAcceptor
Infos: [10.85.0.179]:5701 [dev] Accepting socket connection from /10.85.0.179:42955
mars 11, 2014 5:56:01 PM com.hazelcast.nio.TcpIpConnectionManager
Infos: [10.85.0.179]:5701 [dev] 5701 accepted socket connection from /10.85.0.179:42955
mars 11, 2014 5:56:07 PM com.hazelcast.cluster.ClusterService
Infos: [10.85.0.179]:5701 [dev]
Members [2] {
Member [10.85.0.179]:5701 this
Member [10.85.0.179]:5702
}
mars 11, 2014 5:56:07 PM com.hazelcast.partition.PartitionService
Infos: [10.85.0.179]:5701 [dev] Re-partitioning cluster data... Migration queue size: 135
mars 11, 2014 5:56:08 PM com.hazelcast.partition.PartitionService
Infos: [10.85.0.179]:5701 [dev] All migration tasks has been completed, queues are empty.
mars 11, 2014 5:56:16 PM com.hazelcast.nio.TcpIpConnection
Infos: [10.85.0.179]:5701 [dev] Connection [Address[10.85.0.179]:5702] lost. Reason: Socket explicitly closed
mars 11, 2014 5:56:16 PM com.hazelcast.cluster.ClusterService
Infos: [10.85.0.179]:5701 [dev] Removing Member [10.85.0.179]:5702
mars 11, 2014 5:56:16 PM com.hazelcast.partition.PartitionService
Infos: [10.85.0.179]:5701 [dev] Partition balance is ok, no need to re-partition cluster data...
mars 11, 2014 5:56:16 PM com.hazelcast.cluster.ClusterService
Infos: [10.85.0.179]:5701 [dev]
Members [1] {
Member [10.85.0.179]:5701 this
}
This bug is reproducible every launch.
The following code gives an error:
package fr.utbm.set.smartgrid.sarl.agent
The error is: missing EOF at '.'
.
In sarl code, we have :
event Initialize {
var parameters : Object[]
}
but we have to use occurence.parameters
as a List in on Initialize
which means occurence.parameters[0]
cannot be interpreted.
Define directly in SARL some of the BICs that are currently defined in Janus
This is the same problem as events and capacities, but I din't see it for agents.
With:
agent MyAgent1
{}
agent MyAgent2 extends MyAgent1 // no error
{}
The following Java code is generated:
public class MyAgent2 extends Agent {
Implement a FAQ from the issues labeled FAQ
Add new link FAQ in this page http://www.sarl.io/io/sarl/docs/SARLDocumentationSuite.html after "Reference Documentation"
Use something like http://jnario.org/org/jnario/jnario/documentation/20FactsAboutXtendSpec.html to initiate this page
Already started in
http://www.sarl.io/io/sarl/docs/reference/GeneralSyntaxReferenceSpec.html
To enable to emit the events and the scopes other a network without a complex/costly library such as Gson, the classes io.sarl.lang.core.Event and io.sarl.lang.core.Scope may be serializable.
Is the semantic of the keyword "const" coming from the "const" in C++, "const" or "immutable" in D, "const" or "readonly" in C#, or "final" in Java?
The code from the "counting" demo indicates that the semantic of "const" is the same as the semantic of "final" in Java:
const AtomicInteger count = new AtomicInteger
...
count.incrementAndGet
It may be confusing for developers because "const" means "read only" for most of them.
Moreover, it seems correct to write with the current semantic:
const BigInteger abc = new BigInteger(4)
abc.add(6)
I think it is in contradiction with the use of "const" in the other programming languages. The following "equivalent" code is not working with these languages:
const int abc = 4;
abc = abc + 4;
When we define a behavior we can write:
on E1[e.source!=null]{
println(e.source)
}
in both cases the "e" should be highlighted properly.
Do we enable the access to the inject (IoC in general) in SARL. The final goal consist in enabling that agents configuration could be customized in function of the deployment environment. According to the environment the injected class will be customized.
Could have inject dependent from the architecture: linux, windows, android, etc.
Currently, the API provides three implementation classes for spaces: SpaceBase, EventSpaceImpl, and OpenEventSpaceImpl.
To code a new space implementation, it is currently mandatory to copy/paste the content of these classes in the new class. Indeed, the three classes have a "package" access right.
I suggest to make public these classes to enable third-party developer to code their space implementations based on the existing ones. In this way, they could inherit the networking behavior for example.
The following code highlight an error (Assignment to final field) :
agent TransmitterAgent {
val capacityValue : Double
on Initialize {
capacityValue = occurrence.parameters.get(0) as Double;
}
}
Moreover an error occurs in the java code.
public class TransmitterAgent extends Agent {
/**
* Creates a new Agent of type TransmitterAgent
*/
public TransmitterAgent(final java.util.UUID parentID) { // error
// Multiple markers at this line
// - The blank final field capacityValue may not have been initialized
Currently, the implementation of space specification and the related space seem to be platform-dependent.
It may be helpful to create new space specifications in SARL and linking them to the platform through the injection mechanism (see #26).
When trying to create an agent with the following code, I obtain a compilation error.
event Titi {
}
agent HelloAgent {
uses Lifecycle, Schedules, DefaultContextInteractions
on Initialize {
System.out.println("Hello World!") emit(new Titi)
}
on Titi {
spawn(HelloAgent, #[])
HelloAgent.spawn(#[])
spawn(HelloAgent)
HelloAgent.spawn()
}
/* Print "Goodbye World" before dying */
on Destroy {
System.out.println("Goodbye World!")
}
}
The two first lines with the "spawn" statements are correctly compiled.
The third line with the "spawn" statement gives the error:
Multiple markers at this line
- Type mismatch: cannot convert implicit first argument from
HelloAgent to Class<? extends Agent>
- Type mismatch: cannot convert from Class<HelloAgent> to Object[]
The fourth line with the "spawn" statement gives the error:
Invalid number of arguments. The method spawn(Class<? extends
Agent>, Object[]) is not applicable for the arguments (Class<HelloAgent>)
e,g it could be interessting to have the "type" (the equivalent of class in oo) of the agent spawned :
event AgentSpawned {
var agentID : UUID
var agentType : Type
}
This could be used like this :
agent ObserverAgent {
uses Lifecycle, DefaultContextInteractions
on AgentSpawned [occurrence.agentType.equals(MyType1)]{
}
on AgentSpawned [occurrence.agentType.equals(MyType2)]{
}
}
<!---
@huboard:{"order":8.0,"custom_state":""}
-->
In an agent:
agent ConsumerAgent {
var internalTime : Double = 0 // normal error: Type mismatch: cannot convert from int to Double
var internalTime : Double = 0. // error at next line: no viable alternative at input 'var'
var internalTime : Double = 0d // no error
}
Currently, the class SpaceBase is defined with a "package access".
It may be helpful to define this class as public for enabling easier third-party space implementations.
I want to auto-complete the "Default" in the following code to obtain "DefaultContextInteractions". But the auto-completion mechanism does not work.
agent A {
use DefaultContext
}
In the following code, the auto-completion works correctly, and the "DefaultContextInteractions" is added into the imports.
agent A {
on Initialize {
DefaultContext
}
}
This is a proposal for the syntax related to functions definition and their associated pre- and post- conditions
def push(s: String, i: Integer) : String
with
pre: not Is_Empty(S), i>0;
post: not Is_Empty(push);
{
//function body
push = myString;
}
<!---
@huboard:{"custom_state":"","order":2.607262565755528e-54,"milestone_order":76.98460230969204}
-->
On the website, the sentence "Once you have installed SARL SDK in eclipse you can create a new Maven project and reuse the pom found on the demos." makes my contacts confused because they are not really aware how Maven is working.
We should propose tutorials for both Maven users and non Maven users.
When using nbValues++
or ++nbValues
an error occurs:
for ++nbValues
:
Invalid number of arguments. The method operator_plus(Object,
String) is not applicable for the arguments (Integer)
for nbValues++
:
The method +() is undefined
If I write a code that looks like this :
emit(e1) /* type Event1 */
emit(e2) /* type Event2 */
emit(e3) /* type Event1 */
Can I assume that the fonctions will be called in this order ?
on Event1(e1)
on Event2(e2)
on Event1(e3)
Improve code formatting and organize import
After committed a change in the module "io.sarl.docs.suite", how can I publish the changes on the web server sarl.io? May I use an automatic process, or copy the result of the Maven compilation into the repository sarl.github.io?
The current syntax permits to retrieve the values of the event's parameters:
on Initialize {
myPath = e.parameters.get(0) as String
...
}
To be easier for reading and coding, we could introduce some "suggar" syntax that is equivalent to the previous code:
on Initialize(myPath : String) {
...
}
The features (classes, functions and attributes) that are pushed on the main stream (master on Github) should not be removed until the next major version. Until the next major version, the feature should be deprecated.
This policy is inspirated from the Janus v1 developer guidelines.
Are you agree to use this policy in Sarl also?
The installation guide is missing important information:
To obtain a working Eclipse, I installed the following by hand:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.