Using the proposed methodology we designed the Java-based application that solves the ship loading problem. In that program at the first moment the ControllerAgents are created: CAgentRef startEndController = dpb.makeCAgent("startEndController"); CAgentRef precendenceController = dpb.makeCAgent("precendenceController"); CAgentRef cumulativeController = dpb.makeCAgent("cumulativeController");
Then auxiliary VariableAgent is created which stores the total time of loading operations: VAgentRef general = dpb.makeVAgent("General"); VID generalEnd = general.createVar("General_End", 0, timeHorizon);
After that in the cycle thirty-four VariableAgents are created which correspond to the loading tasks and store needed variables t i start, t i end and duration d i. In the same cycle the duration constraints are created and attached to the corresponding ControllerAgent. for (int j = 0; j < nbTasks; j++) { taskAgents[j] = dpb.makeVAgent("task_agent_" + (j + 1)); taskStarts[j] = taskAgents[j]. createVar("Start", 0, timeHorizon); taskEnds[j] = taskAgents[j].createVar("End", 0, timeHorizon); taskDurations[j] = taskAgents[j]. createVar("Duration", durations[j], durations[j]); DOperation startEndOperation = new Subtract(taskStarts[j], taskEnds[j]); DConstraint startEndConstraint = new Equal(startEndOperation, taskDurations[j]); startEndController.post(startEndConstraint); DConstraint endConstraint =
 new LessOrEqual(taskEnds[j], generalEnd);
startEndController.post(endConstraint); }
Finally the precedence constraint and cumulative constraint are determed and the process of solution search is started. 

With the given conditions in the result of application run the values of variables t i start, t i end will constitute a feasible solution ot the ship loading problem. 

## 7.Conclusions & Future Work

In this article we proposed a new approach for combination of MAS and DCSP in multi-agent swarm systems. This approach called CACS (Controller-Agent for Solving Constraints) based on the use of a specific type of agents called Agent Controller and Variables' Agent. We believe that proposed process of constraint satisfaction in the multi-agent system fits well the general principles of Swarm Intelligence. In particular, the stage of domain reduction in our algorithm may be seen exchange of ―rules, tips and believes about how to process the information [4]‖.

Also in our approach we implemented a principal feature of Swarm systems, which is principal ability to modify multi-agent structure in response of various influencing factors. First of all, declarative manner of constraints based formalization of the problem allows for changing inter- and intra-agent behavior. Secondly, the composition of inter-agent constraints inside ControllerAgent may be changed during evolution of the system (as it shown on fig.1 and fig .2).

In the proposed CACS architecture we see good opportunities for further moving towards to implementation of advanced swarm intelligence capabilities. Modern MAS platforms like JADE implement different peer-to-peer communication mechanisms for which direct correspondence may be found in computational biology. Given such mechanisms as foundation for reliable distributed inter-agent communication we will extend discussed algorithms of interaction between Controllers Agents and Variables Agents by adaptation framework. In such framework agents will be able to discover critical changes in MAS configuration (faults of agents, misbehavior, etc), negotiate responsibilities and change the roles accordingly in order to continue proper collective operations.

 The model of distributed constraints satisfaction proposed in SACS also offers two main contributions in DCSP research. 

First, it is the possibility of a direct and easier dealing with nonbinary constraints without having to use methods of transformation of non-binary constraints to binary constraints. Second, CACS offers us the possibility to organize the constraints logically related groups. This grouping of constraints allows us to form sub-problems, each group is monitored and processed by a single controller. This also helps reduce the total number of Controller Agents needed. 

Non-binary constraints are more common in real problems than binary ones. Some methods are used in order to allow using binary constraint solving techniques on non-binary ones. Methods like hidden and dual transformation [14, 15] convert non-binary constraints into equivalent binary ones. Other methods are proposed in the DCSP domain in order to deal with non-binary constraints. I. Brito [21, 33,34] has proposed organizing agents involved in a non-binary dynamically in order to form a proper propose-validate sequence. Agents then follow that sequence to find a solution for that constraint.

Our algorithm proposes another direct alternative. Any constraint is encapsulated inside a controller agent regardless this constraint is binary or non-binary. Agents involved in any constraint are not forced to follow any order in proposing values for their variables.

The increase in number of agents is an inconvenience of our model. We can investigate the possibility of using a hybrid system of both, our model and a standard ABT model, in order to model a DCSP. In such hybrid system, binary constraints relate variables' agents directly while non-binary constraints are encapsulated inside controller agents. The possibility of gathering constraints gives also the possibility of decreasing the number of agents. The user can group some constraints according to the modeled problem logic.

To prove the feasibility of the proposed theoretical principles we implemented software prototype of CACS. It uses generic interfaces for integration with different third-party MAS-