设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13146|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 H2 A6 o+ ?. ?" o1 |* t7 s

; U4 Z9 S: b) I2 ]. {/ Z$ \( A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 c. R4 t% z  k$ P% ]
" B# Z4 C+ l1 x+ v" c( h/ }begin P_read arriving
8 v. O; M  `2 I) |1 h3 D; T0 d    while 1=1 do begin
' ?4 e! h! ~* |, H: Z& X7 M2 P        read A_tote from "data.txt" with delimiter "\n"3 I, m3 V0 ~- Q9 j* x3 K  A* O# M
        read A_time from "data.txt" with delimiter "\n"  ?4 b  e& S6 x% q9 j3 ]( G* t! s, O$ u
        read A_leave from "data.txt" with delimiter "\n"
: ~: v, e* N6 d1 x2 K        read A_picks from "data.txt" with delimiter "\n"
7 n- o  \0 J) T; M        set load type to A_tote( F0 v5 m; |* A8 e/ H( N+ W) s# c- ?
        if A_tote="tote 1" then set A_induct to 1
! K- ?) g9 u, q% R4 a7 M0 U6 `8 @        else if A_tote="tote 2" then set A_induct to 2$ U  J# ?8 s. ~4 g6 F. b7 U2 s
            else set A_induct to 3   
! a! k! o2 \+ k9 g9 R        set A_i to 0
6 d* M1 y% k" e) g/ g" r( x+ e3 B        clone 1 load to P_induction$ ^$ b$ U9 ^9 M# s: _& f
        wait for A_time sec
6 S, V" e) j% d  z) u& E    end7 f2 ~1 B% O; E, B1 k  i
end  w! l6 h: l- T7 a% D  i$ N. `; C$ q" H
; R1 y7 k  f( M3 e# o1 Z
begin P_induction arriving+ ^6 {$ o- S4 V4 C
    if A_induct=1 then clone 1 load to P_pick1
) u- r$ }% M) C% y4 b9 [    else if A_induct=2 then clone 1 load to P_pick2" J/ E$ K- l9 q1 U8 S
        else clone 1 load to P_pick3
2 \. P3 f5 F9 s/ Q$ \3 [end; l! |& X% @6 Z6 L' ~3 V9 o
4 u" ~, [/ i# ^# H
begin P_pick1 arriving* Z" L% L" y( o/ H! c, b
    set A_i to 1: P- E% j  ]2 _
    move into Q_induct19 X$ T0 f0 f+ h1 P' }
    move into pickaisle.induct1
, e- g: z1 q- h! F9 G    while A_i<=30 do begin
! J- _( e9 N/ z1 ]8 k) Y        travel to pickaisle.con(A_i)  b5 b& P: {: Y: |. r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 @, [0 T0 p8 R  H& ^; T  F+ v        else wait for 10 sec
7 o: n/ w% ^. b        if A_i=A_leave then send to die
' [* F: a3 I# O2 D2 F& P        else inc A_i by 1
, [2 y8 E8 o+ q3 {2 R) b    end
- ~2 o) k& n' vend
! R6 n8 h, S# j
3 C  y9 @$ t, M4 r; B2 Sbegin P_pick2 arriving$ X) t. f5 s. _$ O5 t1 t
    set A_i to 11
; {7 X& L4 t9 W: U- u' v1 b    move into Q_induct2
: \$ ]! L9 L8 v+ m- {6 t    move into pickaisle.induct20 ?: o6 N5 }: }$ A. A, S
    while A_i<=30 do begin8 b1 w( f* B8 V( ]1 Z
        travel to pickaisle.con(A_i)* Q! D# i# _; W) d& F9 s5 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 r' c! v; Z' |! |) b
        else wait for 10 sec
& [* g' s& ~3 z$ F6 N! G        if A_i=A_leave then send to die; G  C7 s8 L" U1 z2 X1 w0 i
        else inc A_i by 1
, E2 ?. M7 o4 E# {2 j; P# [6 F  @    end
! C$ s8 j; [. v7 I8 @7 c+ M2 Oend: I! Q( d4 i3 `' A* z

/ j3 J: x$ @5 k# n$ j; |; xbegin P_pick3 arriving& [0 e; B9 V2 @3 M9 F" K" Q
    set A_i to 21
3 }1 B$ j! d, c% n. z' q% d    move into Q_induct3: x* |  C: F) B0 R: |' C
    move into pickaisle.induct3
) L6 n/ X; T4 M    while A_i<=30 do begin
/ Z( E) {4 c) C/ x1 Y9 u0 f6 l        travel to pickaisle.con(A_i), O( Z9 Z# r. {4 f" \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ?' e  e* Q5 S7 B2 `5 {$ y
        else wait for 10 sec
  n# F3 p( Q  p8 [0 h/ V" {5 O        if A_i=A_leave then send to die
* i# q5 u) a! P- i" q4 Q2 j        else inc A_i by 1
1 Z+ f) j  g1 [8 _% c2 u    end4 h% @$ M) D7 }7 B9 A
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是个什么东东?
) k: T# v* E8 |2 _, b6 T1 Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ j5 f! I+ h, O0 P
% I: t6 ^- v) f" A2 bAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# |! x  e% c  O8 L) @+ u$ Y

) M# g7 |0 c5 v* ^7 c; e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  ^' @1 G. l# T; U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 g# E9 `1 L7 I/ s- e3 }8 V$ o: G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: k; [- \" v' O( R. V  v+ _& u9 o$ ?3 K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, E! j# W) m7 ]
begin P_induction arriving
0 V+ a* _0 w6 I" u% \" z4 t0 X' P' h) m    clone 1 load to P_pick(A_induct)/ n; H2 l; i$ C
end最大的系
$ t3 ^- N4 ^6 O8 x; u6 p: B4 z' P" z
2 @' G7 {3 |- Pbegin P_pick arriving3 K' G# X9 f( O5 Y- \" e- c' `
    set A_i to procindex * 10 + 1
! ^) G) W; E- A9 y8 A    move into Q_induct(procindex)
$ e9 \4 @3 t, y- j( U% _    move into pickaisle.induct(procindex)  j, b9 H% J: R+ Q4 P- @1 p) F
    /*check the type of pickaisle.induct(i), for your last problem.*/
- M  s8 A# j4 U2 N( N) B( O2 Y; c. E, A* z0 l0 m! d$ N
    while A_i<=30 do begin# L' P) r& P" W% g) m9 c0 y
        travel to pickaisle.con(A_i)9 ^  u/ \) X; W: x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  q0 N2 S* K* N/ ^        else wait for 10 sec, A* s4 l. i3 ~7 e7 `
        if A_i=A_leave then send to die- T7 T) Z# G% c5 I/ z2 @
        else inc A_i by 1
, E7 @& {* `, G: h" f& J7 p/ B2 f    end
: d. Y% Y9 E- T6 t  c# eend5 [; Q) y7 ^0 B; l( f0 w& \* B) i. Z
! S) u' L0 I; `; T+ ^/ Z
其中的procindex为整形,代表当前process的序号。5 i( R7 @! G3 w/ e
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-3-22 05:05 , Processed in 0.015594 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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