insalata.planning package¶
Submodules¶
insalata.planning.FastDownwardParser module¶
-
class
insalata.planning.FastDownwardParser.
FastDownwardParser
¶ Bases:
insalata.planning.PlanParserBase.PlanParserBase
Get an ordered execution plan of functions based on the plan file of Fast-Downward.
- Keyword arguments:
- objects – A dictionary with all objects associated with the name used for them in the plan. functionDict – A dictionary with all available functions associated with their all lower case name. planFile – Path to the file containing the plan.
- Returns:
- A linear ordered list of function pointers from the setup module, associated with their respective parameter.
-
parsePlan
(objects, functionDict, planFile)¶
insalata.planning.MetricFFParser module¶
-
class
insalata.planning.MetricFFParser.
MetricFFParser
¶ Bases:
insalata.planning.PlanParserBase.PlanParserBase
Get an ordered execution plan of functions based on the plan file of Metric-FF.
- Keyword arguments:
- objects – A dictionary with all objects associated with the name used for them in the plan. functionDict – A dictionary with all available functions associated with their all lower case name. planFile – Path to the file containing the plan.
- Returns:
- A linear ordered list of function pointers from the setup module, associated with their respective parameter.
-
parsePlan
(objects, functionDict, planFile)¶
insalata.planning.PlanParserBase module¶
insalata.planning.planner module¶
-
insalata.planning.planner.
getObjectDict
(oldConfig, newConfig)¶ Creates a dictionary containing all elements of a plan associated with their name.
- Keyword arguments:
- oldConfig – Configuration representing current (or ‘old’) testbed state newConfig – Configuration representing new testbed state
-
insalata.planning.planner.
getPddlType
(template)¶ Find a suitable PDDL type for this template
Parameters: template (insalata.model.Template.Template) – Template to find a suitable PDDL type for Returns: One of the types defined in the domain file for this problem domain. Return type: str
-
insalata.planning.planner.
getPlan
(logger, oldConfig, newConfig, diff)¶ Get an ordered execution plan of functions based on the newConfig and the diff-dictionary given.
- Keyword arguments:
- oldConfig – Configuration representing current (or ‘old’) testbed state newConfig – Configuration representing new testbed state diff – dictionary listing all properties that changed between the old and the new configuration for each object
-
insalata.planning.planner.
toPddlProblem
(diff, state, uid)¶ Translate the differences between two configuration files into a PDDL problem file. This will return the filename of the new created PDDL problem.
- Keyword arguments:
- diff – dictionary listing all elements and how they changed between
- the old and the new configuration
state – All objects associated with their name uid – unique identifier used in file name (to be concise with the resulting plan)
-
insalata.planning.planner.
writeGoal
(outfile)¶ Write the fixed goal of the PDDL problem for all components of the config.
- Keyword arguments:
- outfile – file handle pointing to the problem file
-
insalata.planning.planner.
writeInit
(outfile, diff, state)¶ Specify the initial state of all objects in the new configuration file, depending on how they have changed compared to the old config (diff)
- Keyword arguments:
outfile – file handle pointing to the problem file diff – dictionary listing all properties that changed between
the old and the new configuration for each objectstate – All objects associated with their name
-
insalata.planning.planner.
writeInitDhcpService
(outfile, dhcpDiff, state)¶ Specify the initial state a DHCP service in the new configuration file, depending on how it has changed compared to the old config (diff)
- Keyword arguments:
outfile – file handle pointing to the problem file iface – dictionary listing all properties that changed between
the old and the new configuration for this interface specificallystate – All objects associated with their name
-
insalata.planning.planner.
writeInitDisk
(outfile, diskDiff, state)¶ Specify the initial state of a disk in the new configuration file, depending on how it has changed compared to the old config (diff)
- Keyword arguments:
- outfile – file handle pointing to the problem file diskDiff – dictionary listing all properties that changed between the old and the new configuration for this interface specifically state – All objects associated with their name
-
insalata.planning.planner.
writeInitDnsService
(outfile, dnsDiff, state)¶ Specify the initial state a DHCP service in the new configuration file, depending on how it has changed compared to the old config (diff)
- Keyword arguments:
outfile – file handle pointing to the problem file iface – dictionary listing all properties that changed between
the old and the new configuration for this interface specificallystate – All objects associated with their name
-
insalata.planning.planner.
writeInitHosts
(outfile, diff, state)¶ Specify the initial state of all hosts and interfaces in the new configuration file, depending on how they have changed compared to the old config (diff)
- Keyword arguments:
outfile – file handle pointing to the problem file diff – dictionary listing all properties that changed between
the old and the new configuration for each objectstate – All objects associated with their name
-
insalata.planning.planner.
writeInitInterface
(outfile, ifaceDiff, state)¶ Specify the initial state of an interfaces in the new configuration file, depending on how it has changed compared to the old config (diff)
- Keyword arguments:
- outfile – file handle pointing to the problem file ifaceDiff – dictionary listing all properties that changed between the old and the new configuration for this interface specifically state – All objects associated with their name
-
insalata.planning.planner.
writeInitNetworks
(outfile, diff, state)¶ Specify the initial state of all networks in the new configuration file, depending on how they have changed compared to the old config (diff)
- Keyword arguments:
outfile – file handle pointing to the problem file diff – dictionary listing all properties that changed between
the old and the new configuration for each objectstate – All objects associated with their name
-
insalata.planning.planner.
writeObjects
(outfile, diff, objects)¶ Write all objects (networks, hosts, server, router) existing in the new configuration as objects existing in the PDDL problem.
- Keyword arguments:
- outfile – file handle pointing to the problem file diff – dictionary listing all properties that changed between the old and the new configuration for each object state – All objects associated with their name