Skip to content

Commit

Permalink
M agpl-cr-assignment.adb
Browse files Browse the repository at this point in the history
A    agpl-containers-string_integer_maps.ads
M    agpl-cr-assignment.ads
M    agpl-cr-mutable_assignment.adb
M    agpl-cr-mutable_assignment.ads
  • Loading branch information
mosteo committed Aug 26, 2006
1 parent 5fa9a69 commit 4de508a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
34 changes: 34 additions & 0 deletions agpl-containers-string_integer_maps.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
------------------------------------------------------------------------------
-- AGPL --
-- --
-- Copyright (C) 2003 --
-- A. Mosteo. --
-- --
-- Authors: A. Mosteo. (public@mosteo.com) --
-- --
-- If you have any questions in regard to this software, please address --
-- them to the above email. --
-- --
-- This program is free software; you can redistribute it and/or modify --
-- it under the terms of the GNU General Public License as published by --
-- the Free Software Foundation; either version 2 of the License, or (at --
-- your option) any later version. --
-- --
-- This program is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public License --
-- along with this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
------------------------------------------------------------------------------

with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;

package Agpl.Containers.String_Integer_Maps is
new Ada.Containers.Indefinite_Hashed_Maps
(String, Integer, Ada.Strings.Hash, "=");

pragma Preelaborate (Agpl.Containers.String_Integer_Maps);
9 changes: 9 additions & 0 deletions agpl-cr-assignment.adb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ package body Agpl.Cr.Assignment is
This.Ok := True;
end Clear;

--------------
-- Contains --
--------------

function Contains (This : in Object; Name : in String) return Boolean is
begin
return This.Agents.Contains (Name);
end Contains;

------------------
-- Empty_Object --
------------------
Expand Down
3 changes: 3 additions & 0 deletions agpl-cr-assignment.ads
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ package Agpl.Cr.Assignment is

procedure Clear (This : in out Object);

function Contains (This : in Object; Name : in String) return Boolean;
-- Says if the named agent is in the assignment.

procedure Fill_Owners (This : in Object; Plan : in out Htn.Plan.Object);
-- Fill the owners of tasks in a plan with this assignment.

Expand Down
8 changes: 8 additions & 0 deletions agpl-cr-mutable_assignment.adb
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,14 @@ package body Agpl.Cr.Mutable_Assignment is
Reevaluate_Costs (This);
end Set_Costs;

procedure Set_Criterion (This : in out Object;
Criterion : in Assignment_Criteria)
is
C : constant Static_Context_Access := This.Context.Ref;
begin
C.Criterion := Criterion;
end Set_Criterion;

-------------------
-- Set_Attribute --
-------------------
Expand Down
3 changes: 3 additions & 0 deletions agpl-cr-mutable_assignment.ads
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ package Agpl.Cr.Mutable_Assignment is
-- *MUST* include cost from No_Task to No_Task (i.e. past incurred costs
-- of a now idle robot...)

procedure Set_Criterion (This : in out Object;
Criterion : in Assignment_Criteria);

procedure Set_Tasks (This : in out Object;
Plan : in Htn.Plan.Object);
-- The tasks are provided in Plan form, inflated or not.
Expand Down

0 comments on commit 4de508a

Please sign in to comment.