设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13988|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& I- f: W  y. E( b) [4 o
7 v% @, `5 E  K# A& |5 x; A* E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ W9 _; @; C7 j
! \1 K: u3 M; k( ?. Z6 F+ G2 M2 z3 C( Cbegin P_read arriving
7 k* l4 ?1 ?5 K1 K    while 1=1 do begin
# h4 g3 M8 {3 S% l" h, P        read A_tote from "data.txt" with delimiter "\n"- Q9 Q! Q. b' _' K# P# z
        read A_time from "data.txt" with delimiter "\n"* D3 F- @5 ]9 w: z$ @: t
        read A_leave from "data.txt" with delimiter "\n"
. l, a0 o! A# R        read A_picks from "data.txt" with delimiter "\n"1 q5 G9 Y, y; i& Q9 Q7 V- \
        set load type to A_tote
0 h# O0 i6 f( h        if A_tote="tote 1" then set A_induct to 1
, [$ R5 N& c/ ?9 z        else if A_tote="tote 2" then set A_induct to 2
7 w+ p  n6 x* m- }  N$ g5 z3 N5 u            else set A_induct to 3    6 q  A: C9 G: v0 h) R  K7 _
        set A_i to 0
6 h) T8 T+ Y# c        clone 1 load to P_induction
1 t9 u3 I. G" O. d- J        wait for A_time sec
: K6 V, U. T6 E# P    end
0 D* h4 s8 `& @* |; z$ Uend9 u2 x1 l- M" c0 n) N/ O
# K7 s0 ?9 R1 P% V, `
begin P_induction arriving& q7 E4 q) i& W
    if A_induct=1 then clone 1 load to P_pick1& s. m9 Y& c8 I& G+ l& j  \
    else if A_induct=2 then clone 1 load to P_pick2
- w% K" }$ g: e9 ]/ C        else clone 1 load to P_pick3# Q1 g! E9 t, ?5 t6 i" D4 V$ D
end
/ D9 q$ f' S, F- p  d' e& I+ i9 j: S# Z0 c  L. K$ f
begin P_pick1 arriving6 o0 e/ S6 k# n
    set A_i to 1# `, G9 @: [. f0 c: |1 m  d
    move into Q_induct1# D1 L& R: t/ [) y2 D2 Z
    move into pickaisle.induct19 e7 i( n+ I1 N$ A! i& K7 A
    while A_i<=30 do begin
- W' H/ s/ ^. v  D* i$ F        travel to pickaisle.con(A_i)* n0 y+ A, t3 c5 v: l: z5 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 n3 t6 J: K* Q7 B4 H" c3 W; A/ V        else wait for 10 sec, d) K, v" r7 P9 H5 k
        if A_i=A_leave then send to die3 x) f- \9 b& e1 o7 y7 z2 `
        else inc A_i by 18 W! I1 U# S8 ^- Q: ]0 S- m2 t' @* ]
    end: x2 T3 D6 J/ g
end
  k% j$ k$ ?, |9 H( I: o; K: z/ G* G- ]6 F. v
begin P_pick2 arriving! h1 ]- ?& V+ b" ^0 Q9 Y
    set A_i to 11
. ~, |: E0 U3 h1 z; J- p    move into Q_induct2) f. u% H/ |! ~  f
    move into pickaisle.induct2( b4 W# o) d, N7 @2 U2 X) r
    while A_i<=30 do begin/ j, P: _5 @' C9 U0 l( [+ q% u
        travel to pickaisle.con(A_i)
; W  o/ Q1 ~: K0 w* c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D0 ?% D9 T- Z
        else wait for 10 sec
" \  U' [, }) v: t" M. ?' k8 Z% B        if A_i=A_leave then send to die& c- x+ R; z' N
        else inc A_i by 13 o! `5 M6 U. Z/ U1 ?
    end
# u6 t  a, F% Q5 d7 f; lend
0 t, ^; F. S$ q7 G0 x1 ?; {( U
9 z5 s  m, G; h3 r/ i# s. Y* cbegin P_pick3 arriving
  l! f7 q# E4 ^7 G9 v; b    set A_i to 211 d6 T9 M0 G" @
    move into Q_induct3" _+ q+ m# D7 Y  H) F
    move into pickaisle.induct35 ?) \' ~# r% r1 c3 y, m
    while A_i<=30 do begin
0 Q2 ^' L7 T/ r/ d! B        travel to pickaisle.con(A_i)  `) J% R, m$ y& p$ f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# f% W, I5 H3 t" N$ g% I
        else wait for 10 sec
9 [0 b2 b& |0 L( H3 W3 q3 L- F) X        if A_i=A_leave then send to die' S- q8 C4 c& x
        else inc A_i by 1
; J; t* b' H2 A+ k    end, s1 |+ w6 ~. v$ g$ j5 [
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是个什么东东?3 h0 L; ~# ^2 Z( Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. `; E6 ?: P! U9 h8 f

2 h2 F' r2 ^! V  [2 p$ ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* n9 d5 v& h  u7 t7 T$ P% U4 {& a! C

( f3 X7 r6 ~1 \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" L2 h2 p% r. n  p) s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 \7 G2 H$ ?# ]% M0 v' c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" E& r) y* [- Z6 J% N3 z/ C
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 R) c# J) ]  d4 y2 y
begin P_induction arriving/ X; u& ?( w$ X
    clone 1 load to P_pick(A_induct)
2 c" Q& D% y5 _end最大的系0 Z" g# N7 A( z) g
- j3 `7 |# c; a5 f- a1 K
begin P_pick arriving
( y* U) E" l, J. U% Q* Q* ^    set A_i to procindex * 10 + 1- D5 C  D, k  B5 f, t7 {) @7 s
    move into Q_induct(procindex)
& D8 L% D& A# C: C    move into pickaisle.induct(procindex)2 n' a! I, j& |0 B4 e1 r
    /*check the type of pickaisle.induct(i), for your last problem.*/! _$ R' ]7 B" I5 ~; U. O

0 x$ z, J. Q; ?+ a' H6 C+ w- v7 `    while A_i<=30 do begin
3 g7 |1 g( W5 }8 ~9 q        travel to pickaisle.con(A_i)+ y( m- J' D! J* i) q# a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 i) a4 N7 ?/ R: E6 V/ ^
        else wait for 10 sec
* ~& D5 G. z( n- q/ ]) [8 W        if A_i=A_leave then send to die
* g0 N- U) U4 {! I- \" }7 K        else inc A_i by 17 F" ], O/ D; L* s
    end
4 i8 X" r7 D8 z4 yend
/ n' e) ?4 ^; |6 P/ P, x& }2 D# l
% d% x7 r0 s* _. |* Y9 `5 l! f% e其中的procindex为整形,代表当前process的序号。& h- m7 g; l+ y& J2 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-5-27 21:03 , Processed in 0.018303 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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