设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12628|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  m6 X! w  z4 Z: E( x4 w

6 K9 S7 R! x3 c# k' W7 X我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。, V# |/ t0 h, f" V) Z. q  u
- w# `0 H( k0 D2 x' W, n' w$ }7 C
begin P_read arriving
6 R0 l. A( ^" |6 A! m$ _4 S    while 1=1 do begin
% G, x3 Z; G  \" [6 _        read A_tote from "data.txt" with delimiter "\n"! d; g1 g2 l% k
        read A_time from "data.txt" with delimiter "\n"
5 @8 _. a6 P' r/ _+ K, L: R        read A_leave from "data.txt" with delimiter "\n"" p3 L: w1 L$ @3 F- F( z/ Y( t
        read A_picks from "data.txt" with delimiter "\n"2 p. B" z1 |: L7 ]" w/ w# _
        set load type to A_tote
) V0 q4 O' q) }4 G1 M        if A_tote="tote 1" then set A_induct to 1
& l4 r7 ?6 y8 k7 K0 o        else if A_tote="tote 2" then set A_induct to 2
* q1 D. v) J) r: ^/ \: v            else set A_induct to 3   
2 ~/ Z% r: R; U- {/ S: J; Q        set A_i to 0
1 {+ B: t2 d  O) H% {& B( v        clone 1 load to P_induction/ y# F! K  ^7 a3 G
        wait for A_time sec# w1 E. t2 r+ z3 m# N, B
    end& Q! {5 |# a8 c5 {
end
6 q! v9 u! t7 n: A- d3 E* J# c) d
9 G3 x# A  `2 W4 d" ?begin P_induction arriving) n6 X0 C$ v1 Y( Y" h
    if A_induct=1 then clone 1 load to P_pick1
( P" |, j) _* _: @. ^5 Q9 U    else if A_induct=2 then clone 1 load to P_pick2/ G2 X: g* ~7 |6 y
        else clone 1 load to P_pick3
, \; p1 P, x4 r% ?+ mend& L+ h: k3 n2 O$ K

* ?6 V$ S+ ~, A! Dbegin P_pick1 arriving
+ i2 E2 F* u- a9 X' {' k  `    set A_i to 1+ \% I" I; s0 K2 u) U
    move into Q_induct1
* M3 }; c, f3 k* u$ Y    move into pickaisle.induct18 Q' \* Q1 |% p5 M
    while A_i<=30 do begin6 z$ {% o( _& ?* u5 R6 N, ]
        travel to pickaisle.con(A_i)% a. B$ s9 e6 I1 @4 C: `+ ]& ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) B5 D$ F2 P0 i# _
        else wait for 10 sec, [- {0 t( z# z8 i; u
        if A_i=A_leave then send to die
0 ]1 O+ c9 V' N7 z        else inc A_i by 1
4 _# }) m# O8 K    end
7 P/ i" F+ K! g: Y8 D5 K* e5 Uend2 J  |. D8 q: M8 L- j. b

% H! l: Z% g9 X# U$ Q9 xbegin P_pick2 arriving3 T8 d( j! A3 Y+ u
    set A_i to 11
2 K2 L2 p( X5 d/ r9 r# p1 P) A    move into Q_induct2) c$ J9 z% d, h7 N! Q+ q# @
    move into pickaisle.induct2
4 _1 }8 U) ^& Z$ g0 z- a) Z    while A_i<=30 do begin$ d+ n2 A3 c* q! T
        travel to pickaisle.con(A_i)0 [6 w  ~) h8 v# N' Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 y5 p' [) \) {0 I" G        else wait for 10 sec0 u$ _1 e! H( z8 t$ k8 L; ]
        if A_i=A_leave then send to die! ^  n. G! E3 i1 I; E1 h
        else inc A_i by 1
' r. B0 g9 t2 G4 O    end
2 U& n$ Y8 i7 M$ u: ^8 U- d  Yend
3 ~5 e: ~( ?4 S' p7 i1 k0 b' M7 c# v2 R; `
begin P_pick3 arriving+ Q2 \5 f8 M* `; r3 T& E
    set A_i to 212 b' Y, C; n/ O6 u
    move into Q_induct3
+ @: W+ e. ]3 ~( z& E  E# ?    move into pickaisle.induct3- A& r0 \4 k% }# f1 ^1 D- \) j  Q
    while A_i<=30 do begin
6 p" N! w6 k& f# o4 A1 H" U        travel to pickaisle.con(A_i)
4 N) @0 \9 ^6 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! A& U2 t5 b2 ^        else wait for 10 sec' [; ~3 ~3 b9 E7 l+ L; L
        if A_i=A_leave then send to die- [7 R  a/ R! x3 P( {! H
        else inc A_i by 1; d1 f$ D1 [; x- h6 B: z) {! E9 e/ o( T
    end5 _5 f. i2 T7 r; Z
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
! z0 W2 T& y& v: M6 r  @+ Z8 rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 [6 X4 a& K" T" q+ T& `- e
: |% S8 v3 Z  Q6 P6 dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 Q2 Z+ ]+ u" J4 A9 [

: @/ ?. s4 ^  l* s( _( w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 Y9 q; D- D0 M) F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 |) P, M( K( N+ F$ ]7 D  ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 w  M9 q+ Q( X1 _: n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 X# m! h$ L6 O
begin P_induction arriving
: x8 V6 F3 v0 y    clone 1 load to P_pick(A_induct)' a9 @" m* n5 w
end最大的系4 H  u- C1 U$ J% [0 D. w- E$ f

& K5 `0 ^7 u! e4 \/ s& c3 Zbegin P_pick arriving6 o" S/ t3 @- k
    set A_i to procindex * 10 + 17 c  v( v, N3 p
    move into Q_induct(procindex)1 |% P+ \6 `: {7 G% Y: T2 z3 i
    move into pickaisle.induct(procindex)0 F3 b# M, s/ U3 f
    /*check the type of pickaisle.induct(i), for your last problem.*/8 J1 J, S9 u' @% {4 U( {

, }8 s5 [, r; d+ O    while A_i<=30 do begin4 \* \  Q% w9 v6 F. M- ~
        travel to pickaisle.con(A_i)
* |2 q5 A. w& L# y# _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  @8 X! j4 f( k5 [: t' L0 \7 @* [        else wait for 10 sec2 d# G5 F2 E' x7 p( T
        if A_i=A_leave then send to die% }8 d& s7 }% K7 D2 f: g2 w
        else inc A_i by 1
3 W- |% T" F. S; F5 _" j5 g3 u    end# E; R$ b3 Z' B1 T7 M
end% {4 ^, e3 b* R- ^. g, L5 c

# `+ C. A) ?% s+ m其中的procindex为整形,代表当前process的序号。0 E! X+ i+ P9 k3 j
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-2-5 23:55 , Processed in 0.017829 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表