设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14181|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' y& `+ k2 @- e0 P. w
3 f/ S% g0 w" ?6 g- E) H1 n# f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# n/ ?, U% q0 b7 G6 ^
$ @2 v& u6 B/ Q  p0 l* _9 F1 S6 B
begin P_read arriving
/ Z+ ]8 p$ p6 y8 E    while 1=1 do begin
! Z7 C& v; M* s- @! m        read A_tote from "data.txt" with delimiter "\n"( q- p+ [$ ^# s1 }( b1 T
        read A_time from "data.txt" with delimiter "\n"( S9 X2 l  }6 u" M) ^( y) x* k
        read A_leave from "data.txt" with delimiter "\n"
: m8 w2 ?, |( Q# F, e0 {6 O- s- O        read A_picks from "data.txt" with delimiter "\n"# m- h2 \" Z* e* U/ G
        set load type to A_tote
  P/ {  T( Z( D; e7 l! {        if A_tote="tote 1" then set A_induct to 1) y4 ]% `0 H# Y6 Q% Z
        else if A_tote="tote 2" then set A_induct to 29 ]9 z7 f2 A6 ~' Y% y* ^
            else set A_induct to 3   
" S7 E0 u: g, }3 n' [        set A_i to 0
" L+ ~2 U% Z) U        clone 1 load to P_induction) G* |! A3 K3 t" e
        wait for A_time sec* b+ y: A/ V: H9 c! I
    end9 v, t: |9 `; f6 a! R! a7 [7 P  I2 A
end% \+ l9 v" }  X' D1 J
4 X* ^* ^8 r; t. B
begin P_induction arriving
3 J# ^$ N7 w4 U7 f+ k8 n    if A_induct=1 then clone 1 load to P_pick1; Z' z! k0 c/ v- b
    else if A_induct=2 then clone 1 load to P_pick2
* `6 a# @. Y" w, i        else clone 1 load to P_pick3( c1 s9 p* B# Y
end
2 Q* t9 O6 [1 W3 y
- E6 R: e* w: U. W) `9 y' xbegin P_pick1 arriving$ _6 k0 {7 J( I$ M9 t; [
    set A_i to 1
8 m/ \" K/ D- s5 t4 f  j    move into Q_induct1
) T0 q5 b5 j, I# U* O2 b- X, H    move into pickaisle.induct1
; ~) N1 X6 r# D# X    while A_i<=30 do begin: F  W' [# B$ X& ~) l& {
        travel to pickaisle.con(A_i)/ @% t( Q. N0 ]5 O8 |: v7 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 t$ t9 n- l4 o
        else wait for 10 sec
8 J' A" X9 j: a4 Z8 o2 ~) L* V        if A_i=A_leave then send to die
. M! k$ Z! Y5 D$ m0 s0 i4 w$ c        else inc A_i by 1  C7 u, I; ], b( d# X( N
    end
: V2 o9 l& P9 gend
; j5 A7 A3 }$ ?) J+ f( x: _
; V3 W$ s1 g, {$ D: t- r, abegin P_pick2 arriving
8 F8 d% C2 N6 P2 v. c0 B4 c0 X    set A_i to 119 o/ u# s4 H: v* @6 ]  y9 ~
    move into Q_induct25 J9 a/ {  H& O; E7 Z
    move into pickaisle.induct2& t8 y: C( R) W; H) Z2 M
    while A_i<=30 do begin/ g9 Q. k3 E2 ]0 J# Z
        travel to pickaisle.con(A_i)3 Z$ y) ]7 U! j6 @4 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 v2 k! l: R7 a4 A
        else wait for 10 sec- a* g- U  d) Z- q4 m$ {0 W
        if A_i=A_leave then send to die
6 o6 I% U! h7 w8 z3 F/ h1 j        else inc A_i by 1
- Z/ x" q+ u0 U+ e$ W9 h$ `8 F& U    end
* e% k: B3 H7 _, Mend- [. w& I1 g  Y
/ G1 m& n' u: U# Q; d( P
begin P_pick3 arriving2 o4 B. T& \+ h/ ^1 C( u+ t& u) g
    set A_i to 21- ?% C, ?# Z5 r7 O" e) G) F1 X
    move into Q_induct3' A+ k- C$ A6 \* F( E* V' `
    move into pickaisle.induct3: g( b& i; b( Y1 K, {
    while A_i<=30 do begin2 ~5 ^* S$ @/ Q1 k& ~- ?! ~
        travel to pickaisle.con(A_i)6 T% \" ]* y6 o1 l5 `9 r+ P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 T/ a6 B! B1 v3 q: t        else wait for 10 sec
2 y! J$ ~: ^9 A) A0 \        if A_i=A_leave then send to die( o5 o; D" f7 R6 l2 E: W% u
        else inc A_i by 1
& [( e9 {; Q  ^    end
5 @4 H7 Q3 |( d" @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是个什么东东?
: \* p& q2 E8 G9 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. N# F0 ^: f8 R" w* w2 d) [) c. O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 ?: O, }: h1 K: I) m" \
9 j& [( z7 q0 k  T2 y$ I另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ M1 B% |( \4 B: t6 m1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ S- r! x- o+ P5 M3 Z( U* A* _" r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 _: G6 Y. T$ i( Z" n4 \  f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% o: b3 y9 Z* \- h' u
begin P_induction arriving
2 ?2 d( L( b3 a, M5 @5 L  S    clone 1 load to P_pick(A_induct)1 Q% c! [$ p9 G" u3 d9 f" t
end最大的系
; U1 ?" a6 [& @1 K/ a" w+ j9 f
. N$ ~* g1 p0 }8 e% zbegin P_pick arriving- f7 S  s7 ~: }- i  ?! s
    set A_i to procindex * 10 + 12 w4 e% g" ^7 [/ Q$ y! Y0 B. D
    move into Q_induct(procindex)
6 y  o1 B4 t: n* X* S    move into pickaisle.induct(procindex). ?& x3 ]' Z) e7 @
    /*check the type of pickaisle.induct(i), for your last problem.*/
( @( Y* o: S% B& G( ?; g* I: R& p. T+ V" Q: s7 c
    while A_i<=30 do begin- j2 l6 R: l2 s3 c9 B9 u" h; Z+ l
        travel to pickaisle.con(A_i)
" ]! ?$ s7 @) R# `: m. n' {6 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  n# G+ W3 e; b
        else wait for 10 sec$ k( Z. k. K! ~/ ^: l; |9 ]
        if A_i=A_leave then send to die
- ?3 x% y: U* r" V        else inc A_i by 18 ^" T, i- H- w" Z+ u2 `6 J
    end
: P& m' n- L- I0 _5 ^5 t# a4 Gend
  g$ q5 ]! U5 m/ f: B- G. v* S
- R5 [3 Y6 d. s0 M1 }其中的procindex为整形,代表当前process的序号。
+ j+ Q/ b8 a9 x! Tstation和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-6-17 21:33 , Processed in 0.013847 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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