设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15273|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 G+ D4 x9 C* m$ \( k' }: q9 u

& b" d8 g- C3 {/ E# A) [# b我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 z" b% J1 a3 f* s) X

% A6 b% X# S, S* D; o' wbegin P_read arriving
, {0 L- N; y# J( I! _4 F" l- Y+ d    while 1=1 do begin
# @. i4 L) l# y& a; a5 x; |" r        read A_tote from "data.txt" with delimiter "\n"5 G' u0 b6 n; ~- Z3 P3 \; g$ ?
        read A_time from "data.txt" with delimiter "\n"
& _1 T9 T8 t. }8 g4 b1 {        read A_leave from "data.txt" with delimiter "\n"3 O, b' a3 W$ x( ^' N% J0 a; M
        read A_picks from "data.txt" with delimiter "\n"
$ u3 A3 q" K4 W' @- h, k        set load type to A_tote+ u% h) n5 }6 |0 k( U# ?% b% ]
        if A_tote="tote 1" then set A_induct to 1
. ]: Z- Y: c; A! ~        else if A_tote="tote 2" then set A_induct to 2$ \% M0 Y# |6 ?. y( @. ~
            else set A_induct to 3    % x; F9 S  j9 S
        set A_i to 0
0 o7 Z: [$ V# K4 J) H: S        clone 1 load to P_induction0 M/ z6 r3 B2 t8 g
        wait for A_time sec, \- l/ P) K( t- l! e
    end0 \- C7 ~2 g9 A# i
end
: M' D+ S0 K8 Z1 u# t+ P
  X. K" w3 ~8 p8 J( D9 m( G* }2 Ibegin P_induction arriving% w# z1 c# k& ?. J) a- I9 x
    if A_induct=1 then clone 1 load to P_pick1
* Y5 h+ D* Y2 H    else if A_induct=2 then clone 1 load to P_pick2
3 g& y; Z; `0 Q  `  s' ]        else clone 1 load to P_pick3. o% K; h6 }4 _$ }" K4 u* o9 z! u
end' t  g, ~/ A) I4 t  k

/ t; H7 x8 u- y! i' J% Obegin P_pick1 arriving
1 ~8 N7 ?& j! o# p* o3 n    set A_i to 1+ U2 a  L" t( Q5 q7 G
    move into Q_induct1& m$ T/ J6 c9 H- ?/ T$ u' a+ E
    move into pickaisle.induct1$ I& X! y# o- X8 ^+ W6 q
    while A_i<=30 do begin
7 O5 O% a  U+ U% ^' _        travel to pickaisle.con(A_i)  ?& D( c3 j0 E$ p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ j! R5 H5 G9 G* k0 E# O+ Q3 P        else wait for 10 sec- S' T3 q$ K# ?$ K* L, M+ C8 f. g
        if A_i=A_leave then send to die
5 ]& ?( A; Z  U- s: z        else inc A_i by 1
7 N. C/ o1 ^) s" [6 |    end) e( o  _! h1 j6 A5 S
end5 M& s0 v9 @. ?4 }1 o
, I8 G- s1 |  |" ?. m1 [5 q
begin P_pick2 arriving2 ~% }6 w7 |1 T9 O" |
    set A_i to 11& j+ Q$ B0 C3 S, x: Q& r' i
    move into Q_induct2; [; C6 Y* E) s3 {$ m4 k2 v! ?
    move into pickaisle.induct2
) u' F, k! U0 u# z/ @    while A_i<=30 do begin  s; }; |" k: l! j8 V0 n% Y- E4 i
        travel to pickaisle.con(A_i)
' l* {0 k- e) t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 g* `4 |2 k3 O5 \        else wait for 10 sec6 G- j' {! Y8 b# p7 S' M! j& J& R
        if A_i=A_leave then send to die
: ^* ~% x; Q, s+ }        else inc A_i by 1
; p3 G/ V: W0 \4 B1 |    end5 P( ]  f& i% v- [) x
end
# Q  u7 R: U" @6 z) O' {8 s; o4 I: v, l7 F7 w
begin P_pick3 arriving0 j3 }) U2 l' P2 W9 I
    set A_i to 21
& @3 ]. [8 V! H, q- d7 h* N) j    move into Q_induct3- I" G1 n! N8 r# {( x1 |
    move into pickaisle.induct3/ d2 B: ]4 q  Y5 U4 x+ x
    while A_i<=30 do begin
8 D2 k  t- c% G$ Q        travel to pickaisle.con(A_i)
2 q! t; u/ _; W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 f4 X0 Y% q% s& {$ J0 m1 e        else wait for 10 sec! y6 h4 }& U5 l; A; w% t- P9 h+ \
        if A_i=A_leave then send to die
: S# `0 l, Y6 }        else inc A_i by 1
. [: d$ t6 ]+ _. a$ H" _, ~1 p4 S    end8 k% O/ ?9 z0 R5 q. n* V
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是个什么东东?
0 G5 ~2 u" r; b# M& Z% r  umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 G8 t+ t# `+ @' t1 q2 {8 C1 h; [3 v! F  A# g" t" L+ C% x5 M
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' |  N8 T8 X3 M1 G" z
2 k3 e+ x$ J9 g& k0 t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 ~4 Q" d. O! Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% ]: q1 w$ L& j+ k0 d; S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; b5 K! ^) p4 s: D* ~" G' u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ E$ e: i1 j( C& F
begin P_induction arriving( [; M3 m% V4 i' D9 f) @
    clone 1 load to P_pick(A_induct)
7 R" W1 }8 Y) oend最大的系+ t5 u$ c3 L! |" c
* j% \& I2 I7 e; w9 F
begin P_pick arriving: J) s: y: M- c" z
    set A_i to procindex * 10 + 1) d' a) ?2 e5 e1 n: \( U8 r6 r
    move into Q_induct(procindex)
5 s; [& i; _3 @* t6 ^    move into pickaisle.induct(procindex)2 ?, L$ D8 w5 q  p
    /*check the type of pickaisle.induct(i), for your last problem.*/3 y1 |$ p( [1 F5 W+ {: n4 y: @

. A1 m9 I4 P) p  [$ X7 f7 ]2 Z    while A_i<=30 do begin  q; s( [& L, z5 }
        travel to pickaisle.con(A_i); Z/ x1 k1 _. T+ ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: G% c2 e  \( V  A* q2 n        else wait for 10 sec, @  i! w4 n3 w7 \/ m0 o
        if A_i=A_leave then send to die
0 M' ~  Z- `9 n- H& A        else inc A_i by 14 {/ F4 w  s5 S9 p5 K  Y2 ?4 s! k- J
    end
& L/ E0 l! }; [end
! `9 _" b* B  D2 e  r
) k8 V# R+ y! c: `+ {  m& K其中的procindex为整形,代表当前process的序号。1 r+ x: R! d, `! D5 V) Y
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-8-29 07:04 , Processed in 0.016289 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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